Files
doitinpoland.com/wp-content/plugins/em-helper-plugin/includes/shortcodes/em_image_slider.php
2023-09-12 21:41:04 +02:00

118 lines
2.4 KiB
PHP

<?php
/*
* Team Section
* Author: EM40
* Author URI: http://raytheme.com
* Version: 1.0
*/
/**
* =======================================================
* KC Shortcode Map
* =======================================================
*/
add_action('init', 'em_image_slider');
if(!function_exists('em_image_slider')):
function em_image_slider(){
if(function_exists('kc_add_map')):
kc_add_map(
array(
'em_image_slider' => array(
'name' => __( 'EM Image Slider', 'cyber' ),
'title' => 'Image Slider',
'icon' => 'fa-photo',
'category' => 'cyber',
'nested' => true,
'accept_child' => 'em_image_slide',
'wrapper_class' => 'clearfix',
'description' => __( 'Display Slick Slider.', 'cyber' ),
'params' => array(
array(
'type' => 'text',
'label' => __( 'Custom class', 'cyber' ),
'name' => 'custom_class',
'description' => __( 'Enter extra custom class', 'cyber' )
)
)
),
)// first array
); // End add map
endif;
}
endif;
/**
* =======================================================
* Register Shortcode banner_slider section
* =======================================================
*/
// [em_image_slider title="" desc="" custom_css_class=""]
if(!function_exists('em_image_slider_function')){
function em_image_slider_function($atts,$content){
ob_start();
$em_image_slider = shortcode_atts(array(
'layout' => 1,
'title1' => '',
'highl' => '',
'title2' => '',
'subtitle' => '',
'desc' => '',
'show_button' => '',
'button_text' => '',
'button_link' => '',
'custom_css' => '',
'custom_class' => '',
),$atts);
extract( $em_image_slider );
//custom class
$wrap_class = apply_filters( 'kc-el-class', $atts );
if( !empty( $custom_class ) ):
$wrap_class[] = $custom_class;
endif;
$extra_class = implode( ' ', $wrap_class );
?>
<!-- INTRO -->
<section class="banner-area em-image-sliderslick <?php echo esc_attr( $extra_class ); ?>">
<?php
// This is for adding master class, so the css system can be worked with this element
echo do_shortcode( str_replace('em_image_slider#', 'em_image_slider', $content ) );
?>
</section>
<!-- /INTRO -->
<?php
return ob_get_clean();
}
add_shortcode('em_image_slider' ,'em_image_slider_function');
}