Last active
November 11, 2022 06:31
-
-
Save ihslimn/f596c7236b4d2642823a30acc5e4df1c to your computer and use it in GitHub Desktop.
JetElements Allow set ID for slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Slider start template | |
*/ | |
$settings = $this->get_settings_for_display(); | |
$class_array[] = 'jet-slider__items'; | |
$class_array[] = 'sp-slides'; | |
$classes = implode( ' ', $class_array ); | |
$widget_classes = $settings['_css_classes']; | |
$add_id = ( false !== strpos( $widget_classes, 'slider-id-is-' ) ); | |
$id = ''; | |
if ( $add_id ) { | |
$widget_classes = explode( ' ', $widget_classes ); | |
foreach ( $widget_classes as $class ) { | |
if ( false !== strpos( $class, 'slider-id-is-' ) ) { | |
$id = 'id="' . explode( 'slider-id-is-', $class )[1] . '"'; | |
break; | |
} | |
} | |
} | |
?> | |
<div <?php echo $id; ?> class="slider-pro"><?php | |
echo sprintf( '<div class="jet-slider__arrow-icon-%s hidden-html">%s</div>', $this->get_id(), $this->_render_icon( 'slider_navigation_icon_arrow', '%s', '', false ) ); | |
echo sprintf( '<div class="jet-slider__fullscreen-icon-%s hidden-html">%s</div>', $this->get_id(), $this->_render_icon( 'slider_fullscreen_icon', '%s', '', false ) ); | |
?><div class="<?php echo $classes; ?>"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment