/**
  *
  */
 public function enqueue_scripts()
 {
     parent::enqueue_scripts();
     if ($this->get_setting('printCss') == 'true') {
         $theme = $this->get_theme();
         wp_enqueue_style('metaslider-' . $this->get_setting('type') . '-slider-' . $theme, METASLIDER_ASSETS_URL . "sliders/nivoslider/themes/{$theme}/{$theme}.css", false, METASLIDER_VERSION);
     }
 }
示例#2
0
 /**
  * Shortcode used to display slideshow
  *
  * @return string HTML output of the shortcode
  */
 public function register_shortcode($atts)
 {
     if (!isset($atts['id'])) {
         return false;
     }
     // handle [metaslider id=123 restrict_to=home]
     if (isset($atts['restrict_to']) && $atts['restrict_to'] == 'home' && !is_front_page()) {
         return;
     }
     // we have an ID to work with
     $slider = get_post($atts['id']);
     // check the slider is published and the ID is correct
     if (!$slider || $slider->post_status != 'publish' || $slider->post_type != 'ml-slider') {
         return "<!-- meta slider {$atts['id']} not found -->";
     }
     // lets go
     $this->set_slider($atts['id'], $atts);
     $this->slider->enqueue_scripts();
     return $this->slider->render_public_slides();
 }
示例#3
0
 /**
  * Shortcode used to display slideshow
  *
  * @return string HTML output of the shortcode
  */
 public function register_shortcode($atts)
 {
     extract(shortcode_atts(array('id' => false, 'restrict_to' => false), $atts, 'metaslider'));
     if (!$id) {
         return false;
     }
     // handle [metaslider id=123 restrict_to=home]
     if ($restrict_to && $restrict_to == 'home' && !is_front_page()) {
         return;
     }
     if ($restrict_to && $restrict_to != 'home' && !is_page($restrict_to)) {
         return;
     }
     // we have an ID to work with
     $slider = get_post($id);
     // check the slider is published and the ID is correct
     if (!$slider || $slider->post_status != 'publish' || $slider->post_type != 'ml-slider') {
         return "<!-- meta slider {$atts['id']} not found -->";
     }
     // lets go
     $this->set_slider($id, $atts);
     $this->slider->enqueue_scripts();
     return $this->slider->render_public_slides();
 }
示例#4
0
 /**
  * Include slider assets
  */
 public function enqueue_scripts()
 {
     parent::enqueue_scripts();
     if ($this->get_setting('printJs') == 'true') {
         wp_enqueue_script('metaslider-easing', METASLIDER_ASSETS_URL . 'easing/jQuery.easing.min.js', array('jquery'), METASLIDER_VERSION);
     }
 }