Inventory_Presser_Template_Provider::lie_about_post_thumbnails( bool $has_thumbnail, mixed $post, int $thumbnail_id )

lie_about_post_thumbnails


Description Description

This method lies about whether vehicles have thumbnails so that all template content can be handled by the shortcode.


Top ↑

Parameters Parameters

$has_thumbnail

(bool) (Required)

$post

(mixed) (Required)

$thumbnail_id

(int) (Required)


Top ↑

Return Return

(void)


Top ↑

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( get_post_meta( $thumbnail_id, apply_filters( 'invp_prefix_meta_key', 'photo_number' ), true ) );

			if( ! $is_vehicle_photo )
			{
				return $has_thumbnail;
			}

			//if it's a vehicle with a vehicle photo, lie and say no
			return false;
		}