Inventory_Presser_Template_Provider::lie_about_post_thumbnails( bool $has_thumbnail, int|WP_Post|null $post, int|false $thumbnail_id )
This method lies about whether vehicles have thumbnails so that all template content can be handled by the shortcode.
On This Page
Parameters Parameters
Return Return
(bool)
Source Source
File: includes/class-template-provider.php
public 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 codeCollapse full source codeView on Github