/** * Returns the HTML for the public slide * * @return string slide html */ protected function get_public_slide() { // get the image url (and handle cropping) // disable wp_image_editor if metadata does not exist for the slide $imageHelper = new HW_MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor()); $thumb = $imageHelper->get_image_url(); // store the slide details $slide = array('id' => $this->slide->ID, 'url' => __(get_post_meta($this->slide->ID, 'hw-ml-slider_url', true)), 'title' => __(get_post_meta($this->slide->ID, 'hw-ml-slider_title', true)), 'target' => get_post_meta($this->slide->ID, 'hw-ml-slider_new_window', true) ? '_blank' : '_self', 'src' => $thumb, 'thumb' => $thumb, 'width' => $this->settings['width'], 'height' => $this->settings['height'], 'alt' => __(get_post_meta($this->slide->ID, '_wp_attachment_image_alt', true)), 'caption' => __(html_entity_decode(do_shortcode($this->slide->post_excerpt), ENT_NOQUOTES, 'UTF-8')), 'caption_raw' => __(do_shortcode($this->slide->post_excerpt)), 'class' => "slider-{$this->slider->ID} slide-{$this->slide->ID}", 'rel' => "", 'data-thumb' => ""); // fix slide URLs if (strpos($slide['url'], 'www.') === 0) { $slide['url'] = 'http://' . $slide['url']; } $slide = apply_filters('hw_metaslider_image_slide_attributes', $slide, $this->slider->ID, $this->settings); // return the slide HTML switch ($this->settings['type']) { case "coin": return $this->get_coin_slider_markup($slide); case "flex": return $this->get_flex_slider_markup($slide); case "nivo": return $this->get_nivo_slider_markup($slide); case "responsive": return $this->get_responsive_slides_markup($slide); default: return $this->get_flex_slider_markup($slide); } }
/** * Get the thumbnail for the slide */ public function get_thumb() { $imageHelper = new HW_MetaSliderImageHelper($this->slide->ID, 150, 150, 'false'); return $imageHelper->get_image_url(); }