PluginProbe ʕ •ᴥ•ʔ
Slider Ultimate / 2.0.8
Slider Ultimate v2.0.8
trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9
ultimate-slider / views / View.Slide.WooCommerce.class.php
ultimate-slider / views Last commit date
Base.class.php 5 years ago View.Slide.UPCP.class.php 4 years ago View.Slide.URP.class.php 4 years ago View.Slide.WooCommerce.class.php 4 years ago View.Slide.class.php 4 years ago View.Slider.class.php 4 years ago View.class.php 4 years ago
View.Slide.WooCommerce.class.php
60 lines
1 <?php
2
3 /**
4 * Class to display a slide in the slider on the front end.
5 *
6 * @since 2.0.0
7 */
8 class ewdusViewSlideWooCommerce extends ewdusViewSlide {
9
10 /**
11 * Get the content (image, title, etc.) of the slide
12 *
13 * @since 2.0.0
14 */
15 public function get_slide_content() {
16
17 if ( empty( $this->ID ) ) { return; }
18
19 $wc_product_id = get_post_meta( $this->ID, "EWD_US_WC_Product_ID", true );
20
21 // If this is a slide that has been assigned a product, load the product
22 if ( $wc_product_id ) {
23
24 $post = get_post( $wc_product_id );
25
26 if ( ! $post ) { return; }
27
28 $this->title = $post->post_title;
29 $this->filtered_content = str_replace( ']]>', ']]&gt;', apply_filters( 'the_content', $post->post_content ) );
30 $this->post_thumbnail_id = get_post_thumbnail_id( $post->ID );
31 $this->image_url = $this->post_thumbnail_id ? wp_get_attachment_url( $this->post_thumbnail_id ) : $this->image_url;
32 }
33 else {
34
35 parent::get_slide_content();
36 }
37
38 }
39
40 /**
41 * Get the initial slide css classes
42 * @since 2.0.0
43 */
44 public function slide_classes( $classes = array() ) {
45
46 $parent_classes = parent::slide_classes();
47
48 $classes = array_merge(
49 $classes,
50 $parent_classes,
51 array(
52 'woocommerce_slide'
53 )
54 );
55
56 return apply_filters( 'us_slide_classes', $classes, $this );
57 }
58
59 }
60