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.UPCP.class.php
51 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->ID ) ) { return; } |
| 18 | |
| 19 | if ( ! class_exists( 'UPCP_Product' ) ) { return; } |
| 20 | |
| 21 | $upcp_product_id = get_post_meta( $this->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 | $product = $upcp_product_id ? new UPCP_Product( array( 'ID' => $upcp_product_id ) ) : new UPCP_Product( array( 'ID' => $this->ID ) ); |
| 25 | |
| 26 | $this->title = $product->Get_Product_Name(); |
| 27 | $this->filtered_content = $product->Get_Field_Value( 'Item_Description' ); |
| 28 | $this->image_url = $product->Get_Field_Value( 'Item_Photo_URL' ); |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Get the initial slide css classes |
| 33 | * @since 2.0.0 |
| 34 | */ |
| 35 | public function slide_classes( $classes = array() ) { |
| 36 | |
| 37 | $parent_classes = parent::slide_classes(); |
| 38 | |
| 39 | $classes = array_merge( |
| 40 | $classes, |
| 41 | $parent_classes, |
| 42 | array( |
| 43 | 'upcp_slide' |
| 44 | ) |
| 45 | ); |
| 46 | |
| 47 | return apply_filters( 'us_slide_classes', $classes, $this ); |
| 48 | } |
| 49 | |
| 50 | } |
| 51 |