294 lines
11 KiB
PHP
294 lines
11 KiB
PHP
<?php
|
|
/*
|
|
* How IT Work Section
|
|
* Author: https://www.templatemonster.com/vendors/consultant/
|
|
* Author URI: http://webitkurigram.com
|
|
* Version: 1.0
|
|
* ======================================================
|
|
*/
|
|
|
|
/**
|
|
* =======================================================
|
|
* KC Shortcode Map
|
|
* =======================================================
|
|
*/
|
|
|
|
add_action('init', 'em_process_box');
|
|
if(!function_exists('em_process_box')):
|
|
function em_process_box(){
|
|
if(function_exists('kc_add_map')):
|
|
kc_add_map(
|
|
array(
|
|
'em_process_box' => array(
|
|
'name' => __( 'Working Process', 'cyber' ),
|
|
'title' => 'Work Process Settings',
|
|
'icon' => 'kc-icon-feature-box',
|
|
'category' => 'cyber',
|
|
'wrapper_class' => 'clearfix',
|
|
'description' => __( 'Display Process layout style.', 'cyber' ),
|
|
'params' => array(
|
|
'general' => array(
|
|
array(
|
|
'type' => 'radio_image',
|
|
'label' => __( 'Select Feature Style', 'cyber' ),
|
|
'name' => 'layout',
|
|
'admin_label' => true,
|
|
'options' => array(
|
|
'1' => EM40_EXTENSION_URI . 'asstes/images/blog/layout1.jpg',
|
|
'2' => EM40_EXTENSION_URI . 'asstes/images/blog/layout2.jpg',
|
|
),
|
|
'description' => __( 'Select Process Style', 'cyber' ),
|
|
'value' => '1'
|
|
),
|
|
array(
|
|
'name' => 'icon',
|
|
'label' => __( 'Select Icon', 'kingcomposer' ),
|
|
'type' => 'icon_picker',
|
|
'description' => __( 'Select icon For Style Two', 'kingcomposer' ),
|
|
'value' => 'sl-rocket',
|
|
),
|
|
array(
|
|
'name' => 'image',
|
|
'label' => __( 'Avatar Image', 'cyber' ),
|
|
'type' => 'attach_image',
|
|
),
|
|
array(
|
|
'type' => 'text',
|
|
'name' => 'numeric_title',
|
|
'label' => __( 'Process Number Here', 'cyber' ),
|
|
'value' => '01',
|
|
'admin_label' => true
|
|
),
|
|
array(
|
|
'type' => 'text',
|
|
'name' => 'title',
|
|
'label' => __( 'Process Title Here', 'cyber' ),
|
|
'value' => 'Your Name',
|
|
'admin_label' => true
|
|
),
|
|
array(
|
|
'type' => 'textarea',
|
|
'name' => 'desc',
|
|
'label' => __( 'Process Short Description', 'cyber' ),
|
|
'value' => base64_encode('Lorem ipsum dolor sit amet, consecte tur adipisicing elit. Ipsa libero ab voluptatibus itaque quas in voluptas cyber.')
|
|
),
|
|
array(
|
|
'type' => 'text',
|
|
'label' => __( 'Custom class', 'cyber' ),
|
|
'name' => 'custom_class',
|
|
'description' => __( 'Enter extra custom class', 'cyber' )
|
|
)
|
|
),
|
|
|
|
|
|
'styling' => array(
|
|
array(
|
|
'name' => 'css_custom',
|
|
'type' => 'css',
|
|
'options' => array(
|
|
array(
|
|
"screens" => "any,1024,999,767,479",
|
|
'Title' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em_work_progress-title h2'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em_work_progress-title h2'),
|
|
),
|
|
'Desc' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em_work_progress-desc'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em_work_progress-desc'),
|
|
),
|
|
'Icon' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.em_process_icon'),
|
|
array('property' => 'color', 'label' => 'Hover Color', 'selector' => '+:hover .em_process_icon'),
|
|
array('property' => 'background-color', 'label' => 'BG Color', 'selector' => '.em_process_icon'),
|
|
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+:hover .em_process_icon'),
|
|
array('property' => 'border', 'label' => 'Border', 'selector' => '.em_process_icon'),
|
|
array('property' => 'border-color', 'label' => 'Hover Border', 'selector' => '+:hover .em_process_icon'),
|
|
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.em_process_icon,.em_process_icon'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em_process_icon'),
|
|
array('property' => 'height', 'label' => 'Height', 'selector' => '.em_process_icon,.em_process_icon::before'),
|
|
array('property' => 'width', 'label' => 'Width', 'selector' => '.em_process_icon,.em_process_icon::before'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em_process_icon'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em_process_icon'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em_process_icon')
|
|
),
|
|
'Box' => array(
|
|
array('property' => 'background'),
|
|
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+:hover'),
|
|
array('property' => 'text-align', 'label' => 'Box Text Align'),
|
|
array('property' => 'border', 'label' => 'Border'),
|
|
array('property' => 'border-color', 'label' => 'Border Color Hover'),
|
|
array('property' => 'display', 'label' => 'Display'),
|
|
array('property' => 'border-radius', 'label' => 'Border Radius'),
|
|
array('property' => 'box-shadow', 'label' => 'Box Shadow', 'selector' => '+.em_work_progress'),
|
|
array('property' => 'box-shadow', 'label' => 'Box Shadow Hover', 'selector' => '+.em_work_progress:hover'),
|
|
array('property' => 'margin', 'label' => 'Margin'),
|
|
array('property' => 'padding', 'label' => 'Padding'),
|
|
array('property' => 'margin', 'label' => 'Position Hover', 'selector' => '+.em_work_progress:hover')
|
|
),
|
|
'Image' => array(
|
|
array('property' => 'border', 'label' => 'Border', 'selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'border-color', 'label' => 'Border Color Hover','selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'display', 'label' => 'Display','selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'border-radius', 'label' => 'Border Radius','selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'box-shadow', 'label' => 'Box Shadow', 'selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'box-shadow', 'label' => 'Box Shadow Hover', 'selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' =>'.em_work_progress-thumb img'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' =>'.em_work_progress-thumb img'),
|
|
)
|
|
|
|
)
|
|
)
|
|
)
|
|
),
|
|
'animate' => array(
|
|
array(
|
|
'name' => 'animate',
|
|
'type' => 'animate'
|
|
)
|
|
),
|
|
)
|
|
),
|
|
)// first array
|
|
); // End add map
|
|
endif;
|
|
}
|
|
endif;
|
|
|
|
|
|
/**
|
|
* =======================================================
|
|
* Register Shortcode team section
|
|
* =======================================================
|
|
*/
|
|
// [em_process_box title="" desc="" icon=""]
|
|
if(!function_exists('em_process_box_shortcode')){
|
|
function em_process_box_shortcode($atts,$content){
|
|
ob_start();
|
|
$em_process_box = shortcode_atts(array(
|
|
'layout' => '',
|
|
'icon' => '',
|
|
'numeric_title' => '',
|
|
'title' => '',
|
|
'image' => '',
|
|
'desc' => '',
|
|
'custom_css' => '',
|
|
'custom_class' => '',
|
|
),$atts);
|
|
extract( $em_process_box );
|
|
//custom class
|
|
$wrap_class = apply_filters( 'kc-el-class', $atts );
|
|
if( !empty( $custom_class ) ):
|
|
$wrap_class[] = $custom_class;
|
|
endif;
|
|
$extra_class = implode( ' ', $wrap_class );
|
|
|
|
$data_title=$data_desc=$data_numeric_title=$data_img=$img_size=$img_link="";
|
|
$size_array = array('full', 'medium', 'large', 'thumbnail');
|
|
|
|
|
|
if ( !empty( $title ) ) {
|
|
|
|
$data_title .= '<div class="em_work_progress-title"><h2>';
|
|
$data_title .= $title;
|
|
$data_title .= '</h2></div>';
|
|
|
|
}
|
|
if ( !empty( $numeric_title ) ) {
|
|
|
|
$data_numeric_title .= '<div class="em_work_progress-number"><span>';
|
|
$data_numeric_title .= $numeric_title;
|
|
$data_numeric_title .= '</span></div>';
|
|
|
|
}
|
|
if ( !empty( $desc ) ) {
|
|
|
|
$data_desc .= '<div class="em_work_progress-desc"><p>';
|
|
$data_desc .= $desc;
|
|
$data_desc .= '</p></div>';
|
|
|
|
}
|
|
if ( !empty( $image ) ) {
|
|
|
|
if( in_array( $img_size, $size_array ) ){
|
|
$image_data = wp_get_attachment_image_src( $image, $img_size );
|
|
$img_link = $image_data[0];
|
|
}else{
|
|
$image_full_width = wp_get_attachment_image_src( $image, 'full' );
|
|
$img_link = kc_tools::createImageSize( $image_full_width[0], $img_size );
|
|
}
|
|
|
|
}
|
|
|
|
|
|
switch($layout){
|
|
case'3':
|
|
?>
|
|
<div class="em_work_progress <?php echo esc_attr( $extra_class ); ?>">
|
|
<div class="wrok_process_thumb">
|
|
<img src="<?php echo $img_link; ?>" alt="">
|
|
<?php echo $data_numeric_title; ?>
|
|
</div>
|
|
<div class="em_progress_content">
|
|
|
|
<?php echo $data_title; ?>
|
|
<?php echo $data_desc; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
break;
|
|
case'2':
|
|
?>
|
|
<div class="em_work_progress style-two <?php echo esc_attr( $extra_class ); ?>">
|
|
<?php if( !empty( $icon ) ){ ?>
|
|
<div class="em_process-icon">
|
|
<span><i class="<?php echo esc_attr( $icon ); ?>"></i></span>
|
|
<?php echo $data_numeric_title; ?>
|
|
</div>
|
|
<?php } ?>
|
|
<div class="em_progress_content">
|
|
|
|
<?php echo $data_title; ?>
|
|
<?php echo $data_desc; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
break;
|
|
default:
|
|
?>
|
|
<div class="em_work_progress <?php echo esc_attr( $extra_class ); ?>">
|
|
<div class="wrok_process_thumb">
|
|
<img src="<?php echo $img_link; ?>" alt="">
|
|
<?php echo $data_numeric_title; ?>
|
|
</div>
|
|
<div class="em_progress_content">
|
|
|
|
<?php echo $data_title; ?>
|
|
<?php echo $data_desc; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
break;
|
|
|
|
|
|
}
|
|
return ob_get_clean();
|
|
}
|
|
|
|
|
|
|
|
|
|
add_shortcode('em_process_box' ,'em_process_box_shortcode');
|
|
}
|