has_post_thumbnail

Advertisement

Summery Summery

Filters whether a post has a post thumbnail.

Syntax Syntax

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

Parameters 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 Source

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

Advertisement

Changelog Changelog

Changelog
Version Description
5.1.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.