Inventory_Presser_Template_Provider::lie_about_post_thumbnails( bool $has_thumbnail, mixed $post, int $thumbnail_id )
lie_about_post_thumbnails
Contents
Description Description
This method lies about whether vehicles have thumbnails so that all template content can be handled by the shortcode.
Parameters Parameters
- $has_thumbnail
-
(bool) (Required)
- $post
-
(mixed) (Required)
- $thumbnail_id
-
(int) (Required)
Return Return
(void)
Source Source
File: includes/class-template-provider.php
static function lie_about_post_thumbnails( $has_thumbnail, $post, $thumbnail_id ) { if ( ! empty( $post ) && INVP::POST_TYPE != get_post_type( $post ) ) { return $has_thumbnail; } $is_vehicle_photo = 'attachment' == get_post_type( $thumbnail_id ) && ! empty( INVP::get_meta( 'photo_number', $thumbnail_id ) ); if ( ! $is_vehicle_photo ) { return $has_thumbnail; } // if it's a vehicle with a vehicle photo, lie and say no return false; }
Expand full source code Collapse full source code View on Github