Core Function
View Source on Trac ↗ has_post_thumbnail()
has_post_thumbnail( mixed $post = null ) Determines whether a post has an image attached.
Parameters 1 required
| Name / Type | Description |
|---|---|
| (int | | WP_Post | null) $post Optional. Post ID or WP_Post object. Default is global `$post`. Required |
Return Value
(bool)
Whether the post has an image attached.
Function Information
Since Version
2.9.0
Source File
wp-includes/post-thumbnail-template.php
Advertisement