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.


Parameters

$has_thumbnail

(bool) (Required) true if the post has a post thumbnail, otherwise false.

$post

(int|WP_Post|null) (Required) Post ID or WP_Post object. Default is global $post.

$thumbnail_id

(int|false) (Required) Post thumbnail ID or false if the post does not exist.


Return

(bool)


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;
		}