apply_filters( ‘has_post_thumbnail’, bool $has_thumbnail, int|WP_Post|null $post, int|false $thumbnail_id )

In this article

Filters whether a post has a post thumbnail.

Parameters

$has_thumbnailbool
true if the post has a post thumbnail, otherwise false.
$postint|WP_Post|null
Post ID or WP_Post object. Default is global $post.
$thumbnail_idint|false
Post thumbnail ID or false if the post does not exist.

Source

return (bool) apply_filters( 'has_post_thumbnail', $has_thumbnail, $post, $thumbnail_id );

Changelog

VersionDescription
5.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.