| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.3/wp-content/plugins/js_composer/include/classes/shortcodes/ |
Upload File : |
<?php
/**
* Class that handles specific [vc_images_carousel] shortcode.
*
* @see js_composer/include/templates/shortcodes/vc_images_carousel.php
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gallery.php' );
/**
* Class WPBakeryShortCode_Vc_images_carousel
*/
class WPBakeryShortCode_Vc_Images_Carousel extends WPBakeryShortCode_Vc_Gallery {
/**
* Carousel index.
*
* @var int
*/
protected static $carousel_index = 1;
/**
* WPBakeryShortCode_Vc_images_carousel constructor.
*
* @param array $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->jsCssScripts();
}
/**
* Register element specific assets.
*/
public function jsCssScripts() {
wp_register_script( 'vc_transition_bootstrap_js', vc_asset_url( 'lib/vc/vc_carousel/js/transition.min.js' ), [], WPB_VC_VERSION, true );
wp_register_script( 'vc_carousel_js', vc_asset_url( 'lib/vc/vc_carousel/js/vc_carousel.min.js' ), [ 'vc_transition_bootstrap_js' ], WPB_VC_VERSION, true );
wp_register_style( 'vc_carousel_css', vc_asset_url( 'lib/vc/vc_carousel/css/vc_carousel.min.css' ), [], WPB_VC_VERSION );
}
/**
* Get carousel index.
*
* @return string
*/
public static function getCarouselIndex() {
return ( self::$carousel_index++ ) . '-' . time();
}
/**
* Get element slider width.
*
* @param string $size
* @return string
*/
protected function getSliderWidth( $size ) {
global $_wp_additional_image_sizes;
$width = '100%';
if ( in_array( $size, get_intermediate_image_sizes(), true ) ) {
if ( in_array( $size, [
'thumbnail',
'medium',
'large',
], true ) ) {
$width = get_option( $size . '_size_w' ) . 'px';
} elseif ( isset( $_wp_additional_image_sizes ) && isset( $_wp_additional_image_sizes[ $size ] ) ) {
$width = $_wp_additional_image_sizes[ $size ]['width'] . 'px';
}
} else {
preg_match_all( '/\d+/', $size, $matches );
if ( count( $matches[0] ) > 1 ) {
$width = $matches[0][0] . 'px';
}
}
return $width;
}
}