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

102 lines
2.3 KiB
PHP

<?php
/*
* Team Section
* Author: EM40
* Author URI: http://raytheme.com
* Version: 1.0
*/
/**
* =======================================================
* KC Shortcode Map
* =======================================================
*/
add_action('init', 'em_screenshot_slider');
if(!function_exists('em_screenshot_slider')):
function em_screenshot_slider(){
if(function_exists('kc_add_map')):
kc_add_map(
array(
'em_screenshot_slider' => array(
'name' => __( 'EM Screenshot Slider', 'cyber' ),
'title' => 'Screenshot Slider',
'icon' => 'fa-photo',
'category' => 'cyber',
'nested' => true,
'accept_child' => 'em_screenshot_slide',
'wrapper_class' => 'clearfix',
'description' => __( 'Display Screenshot 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_screenshot_slider title="" desc="" custom_css_class=""]
if(!function_exists('em_screenshot_slider_function')){
function em_screenshot_slider_function($atts,$content){
ob_start();
$em_screenshot_slider = shortcode_atts(array(
'custom_css' => '',
'custom_class' => '',
),$atts);
extract( $em_screenshot_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="slider-screenshort slider-screenshot-active <?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_screenshot_slider#', 'em_screenshot_slider', $content ) );
?>
</section>
<!-- /INTRO -->
<?php
return ob_get_clean();
}
add_shortcode('em_screenshot_slider' ,'em_screenshot_slider_function');
}