241 lines
9.2 KiB
PHP
241 lines
9.2 KiB
PHP
<?php
|
|
/*
|
|
* Team Section
|
|
* Author: themetags
|
|
* Author URI: http://webitkurigram.com
|
|
* Version: 1.0
|
|
* ======================================================
|
|
*/
|
|
|
|
/**
|
|
* =======================================================
|
|
* KC Shortcode Map
|
|
* =======================================================
|
|
*/
|
|
|
|
add_action('init', 'cyber_icon_box');
|
|
if(!function_exists('cyber_icon_box')):
|
|
function cyber_icon_box(){
|
|
if(function_exists('kc_add_map')):
|
|
kc_add_map(
|
|
array(
|
|
'cyber_icon_box' => array(
|
|
'name' => __( 'Cyber Ico Box', 'cyber' ),
|
|
'title' => 'Icon Box Settings',
|
|
'icon' => 'kc-icon-feature-box',
|
|
'category' => 'cyber',
|
|
'wrapper_class' => 'clearfix',
|
|
'description' => __( 'Display Icon Box style.', 'cyber' ),
|
|
'params' => array(
|
|
'general' => array(
|
|
|
|
array(
|
|
'name' => 'icon',
|
|
'label' => __( 'Select Icon', 'cyber' ),
|
|
'type' => 'icon_picker',
|
|
'description' => __( 'Select icon display in box', 'cyber' ),
|
|
'value' => 'sl-rocket',
|
|
),
|
|
array(
|
|
'type' => 'text',
|
|
'name' => 'title',
|
|
'label' => __( 'Name', 'cyber' ),
|
|
'value' => 'Your Name',
|
|
'admin_label' => true
|
|
),
|
|
array(
|
|
'type' => 'textarea',
|
|
'name' => 'desc',
|
|
'label' => __( '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' => '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',
|
|
'3' => EM40_EXTENSION_URI . 'asstes/images/blog/layout3.jpg',
|
|
),
|
|
'description' => __( 'Select Your Feature Style', 'cyber' ),
|
|
'value' => '1'
|
|
),
|
|
|
|
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' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.cyber-icon-box-title h5'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.cyber-icon-box-title h5'),
|
|
),
|
|
'Desc' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.cyber-icon-box-desc p'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.cyber-icon-box-desc p'),
|
|
),
|
|
'Icon' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.cyber-icon-box-icon i'),
|
|
array('property' => 'color', 'label' => 'Hover Color', 'selector' => '+:hover .cyber-icon-box-icon i'),
|
|
array('property' => 'background-color', 'label' => 'BG Color', 'selector' => '.cyber-icon-box-icon i'),
|
|
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+:hover .cyber-icon-box-icon i'),
|
|
array('property' => 'border', 'label' => 'Border', 'selector' => '.cyber-icon-box-icon i'),
|
|
array('property' => 'border-color', 'label' => 'Hover Border', 'selector' => '+:hover .cyber-icon-box-icon i'),
|
|
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.cyber-icon-box-icon i,.cyber-icon-box-icon i'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.cyber-icon-box-icon i'),
|
|
array('property' => 'height', 'label' => 'Height', 'selector' => '.cyber-icon-box-icon i,.cyber-icon-box-icon i::before'),
|
|
array('property' => 'width', 'label' => 'Width', 'selector' => '.cyber-icon-box-icon i,.cyber-icon-box-icon i::before'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.cyber-icon-box-icon i'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.cyber-icon-box-icon i'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.cyber-icon-box-icon i')
|
|
),
|
|
'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' => '+.cyber-icon-box'),
|
|
array('property' => 'box-shadow', 'label' => 'Box Shadow Hover', 'selector' => '+.cyber-icon-box:hover'),
|
|
array('property' => 'margin', 'label' => 'Margin'),
|
|
array('property' => 'padding', 'label' => 'Padding'),
|
|
array('property' => 'margin', 'label' => 'Position Hover', 'selector' => '+.cyber-icon-box:hover')
|
|
)
|
|
|
|
)
|
|
)
|
|
)
|
|
),
|
|
'animate' => array(
|
|
array(
|
|
'name' => 'animate',
|
|
'type' => 'animate'
|
|
)
|
|
),
|
|
)
|
|
),
|
|
)// first array
|
|
); // End add map
|
|
endif;
|
|
}
|
|
endif;
|
|
|
|
/**
|
|
* =======================================================
|
|
* Register Shortcode team section
|
|
* =======================================================
|
|
*/
|
|
// [cyber-icon-box_box title="" desc="" icon=""]
|
|
if(!function_exists('cyber_icon_box_shortcode')){
|
|
function cyber_icon_box_shortcode($atts,$content){
|
|
ob_start();
|
|
$cyber_icon_box = shortcode_atts(array(
|
|
'icon' => '',
|
|
'title' => '',
|
|
'desc' => '',
|
|
'layout' => '1',
|
|
'custom_css' => '',
|
|
'custom_class' => '',
|
|
),$atts);
|
|
extract( $cyber_icon_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="";
|
|
$size_array = array('full', 'medium', 'large', 'thumbnail');
|
|
if ( !empty( $title ) ) {
|
|
|
|
$data_title .= '<div class="cyber-icon-box-title"><h5>';
|
|
$data_title .= $title;
|
|
$data_title .= '</h5></div>';
|
|
}
|
|
|
|
if ( !empty( $desc ) ) {
|
|
|
|
$data_desc .= '<div class="cyber-icon-box-desc"><p>';
|
|
$data_desc .= $desc;
|
|
$data_desc .= '</p></div>';
|
|
|
|
}
|
|
|
|
switch($layout){
|
|
case'3':
|
|
?>
|
|
<div class="cyber-icon-box style-two style-three text-center p-5 <?php echo esc_attr( $extra_class ); ?>">
|
|
<div class="cyber-icon-box-content">
|
|
<?php if( !empty( $icon ) ){ ?>
|
|
<div class="cyber-icon-box-icon ">
|
|
<span><i class="<?php echo esc_attr( $icon ); ?>"></i></span>
|
|
</div>
|
|
<?php } ?>
|
|
<?php echo $data_title; ?>
|
|
<?php echo $data_desc; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
break;
|
|
case'2':
|
|
?>
|
|
<div class="cyber-icon-box style-two text-center p-5 <?php echo esc_attr( $extra_class ); ?>">
|
|
<div class="cyber-icon-box-content">
|
|
<?php if( !empty( $icon ) ){ ?>
|
|
<div class="cyber-icon-box-icon">
|
|
<span><i class="<?php echo esc_attr( $icon ); ?>"></i></span>
|
|
</div>
|
|
<?php } ?>
|
|
<?php echo $data_title; ?>
|
|
<?php echo $data_desc; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
break;
|
|
default:
|
|
?>
|
|
<div class="cyber-icon-box default <?php echo esc_attr( $extra_class ); ?>">
|
|
<?php if( !empty( $icon ) ){ ?>
|
|
<div class="cyber-icon-box-icon">
|
|
<span><i class="<?php echo esc_attr( $icon ); ?>"></i></span>
|
|
</div>
|
|
<?php } ?>
|
|
<div class="cyber-icon-box-content">
|
|
<?php echo $data_title; ?>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
break;
|
|
}
|
|
|
|
return ob_get_clean();
|
|
}
|
|
add_shortcode('cyber_icon_box' ,'cyber_icon_box_shortcode');
|
|
}
|