function add_scripts() { wp_register_style('animate', visual_carousel()->acess_url . 'css/animate.min.css'); wp_register_script('jquery.mousewheel', visual_carousel()->acess_url . 'js/jquery.mousewheel.min.js', array('jquery'), '3.1.13', true); wp_register_style('owl.carousel', visual_carousel()->acess_url . 'css/owl.carousel.css'); wp_register_script('owl.carousel', visual_carousel()->acess_url . 'js/owl.carousel.min.js', array('jquery'), '2.0.0', true); wp_register_style('visual-carousel', visual_carousel()->acess_url . 'css/visual-carousel.css'); wp_register_script('visual-carousel', visual_carousel()->acess_url . 'js/visual-carousel.js', array('owl.carousel'), '1.0.0', true); }
function vc_add_shortcode_params() { vc_add_shortcode_param('edge-images-select', array($this, 'vc_images_select'), visual_carousel()->acess_url . 'vc-fields/edge-images-select.js'); vc_add_shortcode_param('visual-carousel-number', array($this, 'number_param_settings_field')); }
function add_admin_script() { wp_enqueue_style('post-visual-carousel', $this->acess_url . 'css/post-visual-carousel.css'); } public static function process_attributes($attributes) { $attr_s = ''; foreach ($attributes as $key => $attr) { $attr_s .= ' ' . $key . '="' . $attr . '"'; } return $attr_s; } } } /** * Returns the main instance of visual_carousel() to prevent the need to use globals. * * @since 1.0 * @return Visual_Carousel */ if (!function_exists('Visual_Carousel')) { function visual_carousel() { return Visual_Carousel::instance(); } } if (defined('VC_CAROUSEL_LATE_LOAD')) { add_action('plugins_loaded', 'visual_carousel', (int) VC_CAROUSEL_LATE_LOAD); } else { visual_carousel(); }
function visual_carousel_get_template_list() { $in_plugin = false; $in_theme = false; /* scan in plugin. */ if (is_dir(visual_carousel()->theme_dir)) { $in_theme = scandir(visual_carousel()->theme_dir); } /* scan in theme. */ if (is_dir(visual_carousel()->template_dir)) { $in_plugin = scandir(visual_carousel()->template_dir); } /* if layouts exists in theme and plugin. */ if ($in_plugin && $in_theme) { unset($in_plugin[0]); unset($in_plugin[1]); unset($in_theme[0]); unset($in_theme[1]); return array_unique(array_merge($in_plugin, $in_theme)); } /* if layouts only exists in plugin. */ if ($in_plugin) { unset($in_plugin[0]); unset($in_plugin[1]); return $in_plugin; } }
* @param object $carousel from post query. * @package Visual Carousel * @version 1.0.0 */ if (!defined('ABSPATH')) { exit; } /* before shortcode. */ do_action('visualcarousel/shortcodes/carousel/before'); ?> <div class="<?php echo implode(' ', $_class); ?> "> <div class="visual-carousel-items"<?php echo visual_carousel()->process_attributes($data); ?> > <?php /* get content template. */ $template_content = visual_carousel_get_template_part('content', '', true); /* from query. */ if (isset($carousel) && $carousel->have_posts()) { while ($carousel->have_posts()) { $carousel->the_post(); load_template($template_content, true); } } /* vc elements. */ echo apply_filters('the_content', $content);