Example #1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     if (!class_exists('MetaSlide')) {
         // check Meta Slider (Lite) is installed and activated
         add_action("admin_notices", array($this, 'check_metaslider_is_installed'));
         return;
     }
     define('METASLIDERPRO_VERSION', $this->version);
     define('METASLIDERPRO_BASE_URL', trailingslashit(plugins_url('ml-slider-pro')));
     define('METASLIDERPRO_ASSETS_URL', trailingslashit(METASLIDERPRO_BASE_URL . 'assets'));
     define('METASLIDERPRO_PATH', plugin_dir_path(__FILE__));
     $this->includes();
     add_filter('metaslider_menu_title', array($this, 'menu_title'));
     add_action('init', array($this, 'load_plugin_textdomain'));
     add_action('metaslider_register_admin_scripts', array($this, 'register_admin_scripts'), 10, 1);
     add_action('metaslider_register_admin_styles', array($this, 'register_admin_styles'), 10, 1);
     add_filter('metaslider_css', array($this, 'get_public_css'), 11, 3);
     new WPUpdatesPluginUpdater_136('http://wp-updates.com/api/2/plugin', plugin_basename(__FILE__));
     new MetaSliderThemeEditor();
     new MetaSliderThumbnails();
     new MetaVimeoSlide();
     new MetaYouTubeSlide();
     new MetaLayerSlide();
     new MetaExternalSlide();
     new MetaSliderLoop();
     $post_feed = new MetaPostFeedSlide();
     $post_feed->hooks();
 }
Example #2
0
 /**
  * Output the carousel HTML for the filmstrip
  *
  * @param string  $html
  * @param integer $slider_id
  * @param array   $settings
  * @return string $html
  */
 public function metaslider_flex_filmstrip_html($html, $slider_id, $settings)
 {
     if (isset($settings["navigation"]) && $settings['navigation'] == 'filmstrip') {
         $slider = new MetaSlider($slider_id, array());
         $query = $slider->get_slides();
         if (isset($settings["noConflict"]) && $settings['noConflict'] == 'true') {
             $class = 'filmstrip';
         } else {
             $class = 'flexslider filmstrip';
         }
         $html .= '<div id="metaslider_' . $slider_id . '_filmstrip" class="' . $class . '">';
         $html .= "\n            <ul class='slides'>";
         while ($query->have_posts()) {
             $query->next_post();
             $type = get_post_meta($query->post->ID, 'ml-slider_type', true);
             if ($type == 'post_feed') {
                 $post_feed = new MetaPostFeedSlide();
                 $post_feed->set_slide($query->post->ID);
                 $post_feed->set_slider($slider_id);
                 $the_query = new WP_Query($post_feed->get_post_args());
                 $slides = array();
                 while ($the_query->have_posts()) {
                     $the_query->the_post();
                     $id = get_post_thumbnail_id($the_query->post->ID);
                     if ($override_id = get_post_meta($the_query->post->ID, 'metaslider_post_feed_image', true)) {
                         if (wp_attachment_is_image($override_id)) {
                             $id = $override_id;
                         }
                     }
                     $imageHelper = new MetaSliderImageHelper($id, $settings['thumb_width'], $settings['thumb_height'], 'true');
                     $url = $imageHelper->get_image_url();
                     $list_item = "<li class=\"ms-thumb slide-{$query->post->ID} post-{$the_query->post->ID}\" style=\"display: none;\"><img src=\"{$url}\" /></li>";
                     $list_item = apply_filters("metaslider_filmstrip_list_item", $list_item, $query->post, $url);
                     $html .= "\n                {$list_item}";
                 }
                 wp_reset_query();
             } else {
                 if ($type == 'external') {
                     $url = get_post_meta($query->post->ID, 'ml-slider_extimgurl', true);
                     $list_item = "<li class=\"ms-thumb slide-{$query->post->ID}\" style=\"display: none;\"><img src=\"{$url}\" /></li>";
                     $list_item = apply_filters("metaslider_filmstrip_list_item", $list_item, $query->post, $url);
                     $html .= "\n                {$list_item}";
                 } else {
                     // generate thumbnail
                     $imageHelper = new MetaSliderImageHelper($query->post->ID, $settings['thumb_width'], $settings['thumb_height'], 'true');
                     $url = $imageHelper->get_image_url();
                     if (strlen($url)) {
                         $list_item = "<li class=\"ms-thumb slide-{$query->post->ID}\" style=\"display: none;\"><img src=\"{$url}\" /></li>";
                         $list_item = apply_filters("metaslider_filmstrip_list_item", $list_item, $query->post, $url);
                         $html .= "\n                {$list_item}";
                     }
                 }
             }
         }
         $html .= "\n            </ul>\n        </div>";
     }
     return $html;
 }