PluginProbe ʕ •ᴥ•ʔ
Slider Ultimate / trunk
Slider Ultimate vtrunk
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.UPCP.class.php
ultimate-slider / views Last commit date
Base.class.php 5 years ago View.Slide.UPCP.class.php 2 years ago View.Slide.URP.class.php 2 years ago View.Slide.WooCommerce.class.php 2 years ago View.Slide.class.php 2 years ago View.Slider.class.php 2 years ago View.class.php 2 years ago
View.Slide.UPCP.class.php
65 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 ewdusViewSlideUPCP 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->post ) or empty( $this->post->ID ) ) { return; }
18
19 if ( ! class_exists( 'UPCP_Product' ) and ! post_type_exists( 'upcp_product' ) ) { return; }
20
21 $upcp_product_id = get_post_meta( $this->post->ID, "EWD_US_UPCP_Product_ID", true );
22
23 // If this is a slide that has been assigned a product, load the product, otherwise load as normal
24 // For UPCP post-version 5.0.0
25 if ( post_type_exists( 'upcp_product' ) ) {
26
27 $product = $upcp_product_id ? get_post( $upcp_product_id ) : get_post( $this->post->ID );
28
29 $this->title = $product->post_title;
30 $this->filtered_content = str_replace( ']]>', ']]&gt;', apply_filters( 'the_content', $product->post_content ) );
31 $this->post_thumbnail_id = get_post_thumbnail_id( $product->ID );
32 $this->image_url = $this->post_thumbnail_id ? wp_get_attachment_url( $this->post_thumbnail_id ) : $this->image_url;
33 }
34 // For UPCP pre-version 5.0.0
35 else {
36
37 $product = $upcp_product_id ? new UPCP_Product( array( 'ID' => $upcp_product_id ) ) : new UPCP_Product( array( 'ID' => $this->post->ID ) );
38
39 $this->title = $product->Get_Product_Name();
40 $this->filtered_content = $product->Get_Field_Value( 'Item_Description' );
41 $this->image_url = $product->Get_Field_Value( 'Item_Photo_URL' );
42 }
43 }
44
45 /**
46 * Get the initial slide css classes
47 * @since 2.0.0
48 */
49 public function slide_classes( $classes = array() ) {
50
51 $parent_classes = parent::slide_classes();
52
53 $classes = array_merge(
54 $classes,
55 $parent_classes,
56 array(
57 'upcp_slide'
58 )
59 );
60
61 return apply_filters( 'us_slide_classes', $classes, $this );
62 }
63
64 }
65