File manager - Edit - /home/carfac/public_html/rephotonet/wordpress/wp-content/plugins/royal-addons/shortcodes/slideshow.php
Back
<?php // Slideshow ([slideshow]) class Royal_Shortcode_Slideshow { public static function slideshow( $atts, $content = null ) { extract( shortcode_atts( array( 'images' => '', 'slideshow_timeout' => '10' ), $atts ) ); $imagesList = '<!-- Images list --> <div class="images-list" data-delay="' . esc_attr( intval( $slideshow_timeout ) ) . '">'; $ids = explode(',', $images); foreach ( $ids as $id ) { $imagesList .= '<img src="' . wp_get_attachment_url( $id ) . '" alt="' . esc_attr__( 'slideshow-images', 'royal-addons' ) . '">'; } $imagesList .= '</div>'; $output = $imagesList . do_shortcode( $content ); $output .= '<!-- Arrows --> <a class="intro-arrow left"><div class="icon icon-arrows-left"></div></a> <a class="intro-arrow right"><div class="icon icon-arrows-right"></div></a>'; return $output; } public static function vc_slideshow() { vc_map( array( "name" => esc_html__( "Slideshow", "royal-addons" ), "base" => "slideshow", "icon" => 'ti-layout-slider', "description" => esc_html__( "Intro slide background", "royal-addons" ), "as_parent" => array( "only" => "slide" ), "js_view" => "VcColumnView", "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "attach_images", "heading" => esc_html__( "Images", "royal-addons" ), "param_name" => "images", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "Slideshow Timeout", "royal-addons" ), "param_name" => "slideshow_timeout", "value" => "10", "description" => "Enter value in seconds", "admin_label" => true, ), ) )); } // Slide ([slide]) public static function slide( $atts, $content = null ) { extract( shortcode_atts( array( ), $atts ) ); return '<!-- Slide --> <div class="single-slide"> <div class="row"> <div class="col-md-12"> <header> <h1 class="offsetTopClear offsetBottomClear text-center animate">' . do_shortcode( $content ) . '</h1> </header> </div> </div> </div>'; } public static function vc_slide() { vc_map( array( "name" => esc_html__( "Slide", "royal-addons" ), "base" => "slide", "icon" => 'ti-layout-slider', "as_child" => array( "only" => "slideshow" ), "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "textarea_html", "heading" => esc_html__( "Content", "royal-addons" ), "param_name" => "content", "value" => "", "description" => "", "admin_label" => true, ), ) )); } } add_shortcode( 'slideshow', array( 'Royal_Shortcode_Slideshow', 'slideshow' ) ); add_shortcode( 'slide', array( 'Royal_Shortcode_Slideshow', 'slide' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Slideshow', 'vc_slideshow' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Slideshow', 'vc_slide' ) ); // Nested shortcodes add_action( 'vc_before_init', function() { // Features extend if (class_exists( 'WPBakeryShortCodesContainer' )) { class WPBakeryShortCode_slideshow extends WPBakeryShortCodesContainer {}; } if (class_exists( 'WPBakeryShortCode' )) { class WPBakeryShortCode_slide extends WPBakeryShortCode {}; } });
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0.24 |
proxy
|
phpinfo
|
Settings