W3cubDocs

/WordPress

apply_filters( 'has_post_thumbnail', bool $has_thumbnail, int|WP_Post|null $post, int|string $thumbnail_id )

Filters whether a post has a post thumbnail.

Parameters

$has_thumbnail

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

$post

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

$thumbnail_id

(int|string) Post thumbnail ID or empty string.

Source

File: wp-includes/post-thumbnail-template.php

View on Trac

Changelog

Version Description
5.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/has_post_thumbnail