PATH:
home
/
fengshp
/
www
/
wp-content
/
plugins
/
themify-builder-pro
/
includes
/
dynamic-content
<?php /** * @package Themify Builder Pro * @link https://themify.me/ */ class Tbp_Dynamic_Item_ProductImage extends Tbp_Dynamic_Item { public static function is_available():bool { return themify_is_woocommerce_active(); } public static function get_category():string { return 'wc'; } public static function get_type():array { return array( 'image', 'url' ); } public static function get_label():string { return __( 'Product Image', 'tbp' ); } public static function get_value(array $args = array()):?string { $product = wc_get_product(!empty( $args['post_id'] )?$args['post_id']:get_the_ID()); return !empty($product)?self::get_image( $product ):''; } /** * Get the featured image for a product. * For variations, the image for the base product is used as substitute. * * @return string */ private static function get_image( $product ) { $imageId = $product->get_image_id(); if ( empty($imageId) ) { $p = $product->get_parent_id(); if ( !empty($p) ) { $parent_product = wc_get_product( $p ); if ( !empty($parent_product) ) { $imageId = $parent_product->get_image_id(); } } } return $imageId ? wp_get_attachment_url( $imageId ) : ''; } public static function get_options():array { return array( array( 'label' => 'tbp_prdid', 'id' => 'post_id', 'type' => 'number', 'help' => 'tbp_prdidh' ), ); } }
[+]
..
[-] ProductSalePrice.php
[edit]
[-] PTBGallery.php
[edit]
[-] WCCheckoutURL.php
[edit]
[-] PostDate.php
[edit]
[-] ACFURL.php
[edit]
[-] PostTermsClass.php
[edit]
[-] PostAuthorURL.php
[edit]
[-] ACFWysiwyg.php
[edit]
[-] PostAuthorEmail.php
[edit]
[-] PTBGalleryAsText.php
[edit]
[-] PTBAudioPlaylist.php
[edit]
[-] ProductTitle.php
[edit]
[-] PTBIconAsIcon.php
[edit]
[-] PTBTelephone.php
[edit]
[-] PTBSelectClass.php
[edit]
[-] ProductCartUrl.php
[edit]
[-] PostAuthorMeta.php
[edit]
[-] tbpTermCover.php
[edit]
[-] PTBEmail.php
[edit]
[-] ArchiveTitle.php
[edit]
[-] SiteURL.php
[edit]
[-] PostAuthorBio.php
[edit]
[-] ACFChoice.php
[edit]
[-] PTBDateAsText.php
[edit]
[-] ACFGallery.php
[edit]
[-] PTBRatingAsText.php
[edit]
[-] ACFEmail.php
[edit]
[-] Option.php
[edit]
[-] PostAuthorClass.php
[edit]
[-] PostCommentCount.php
[edit]
[-] ProductAttributes.php
[edit]
[-] PTBRadioButtonClass.php
[edit]
[-] ACFNumber.php
[edit]
[-] PTBAudio.php
[edit]
[-] PTBTextarea.php
[edit]
[-] PostTerms.php
[edit]
[-] ACFDate.php
[edit]
[-] PTBText.php
[edit]
[-] PostFeaturedImage.php
[edit]
[-] PTBAccordion.php
[edit]
[-] ACFoEmbed.php
[edit]
[-] ProductSKU.php
[edit]
[-] Shortcode.php
[edit]
[-] CurrentDate.php
[edit]
[-] PTBFile.php
[edit]
[-] PTBLinkButton.php
[edit]
[-] PTBMap.php
[edit]
[-] PTBRadioButton.php
[edit]
[-] CustomField.php
[edit]
[-] PTBRating.php
[edit]
[-] ACFFile.php
[edit]
[-] PTBCheckboxClass.php
[edit]
[-] FileContent.php
[edit]
[-] PTBVideoPlaylist.php
[edit]
[-] PTBRepeatableText.php
[edit]
[-] ProductDescription.php
[edit]
[-] PTBIcon.php
[edit]
[-] ArchiveDescription.php
[edit]
[-] PostImageAttachments.php
[edit]
[-] ACFMap.php
[edit]
[-] PTBRelations.php
[edit]
[-] PostAuthorName.php
[edit]
[-] PostAuthorAvatar.php
[edit]
[-] PTBVideo.php
[edit]
[-] ACFText.php
[edit]
[-] PTBDate.php
[edit]
[-] ACFImage.php
[edit]
[-] ACFTextarea.php
[edit]
[-] ProductImage.php
[edit]
[-] PTBNumber.php
[edit]
[-] ProductRating.php
[edit]
[-] ProductStock.php
[edit]
[-] PTBImage.php
[edit]
[-] ProductPrice.php
[edit]
[-] SiteDescription.php
[edit]
[-] EventPostDate.php
[edit]
[-] SiteTitle.php
[edit]
[-] ProductGallery.php
[edit]
[-] MediaLibrary.php
[edit]
[-] RandomNumber.php
[edit]
[-] PostExcerpt.php
[edit]
[-] PTBCheckbox.php
[edit]
[-] ProductCatImage.php
[edit]
[-] PostTitle.php
[edit]
[-] PostClass.php
[edit]
[-] PTBProgressBar.php
[edit]
[-] PTBIconAsText.php
[edit]
[-] ACFPageLink.php
[edit]
[-] PostPermalink.php
[edit]
[-] SiteIcon.php
[edit]
[-] PTBAcc.php
[edit]
[-] PTBSelect.php
[edit]