Core Function
View Source on Trac ↗ get_post_thumbnail_id()
get_post_thumbnail_id( mixed $post = null ) Retrieves the post thumbnail ID.
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
((int)
(int | false) Post thumbnail ID (which can be 0 if the thumbnail is not set),
or false if the post does not exist.
Function Information
Since Version
2.9.0
Source File
wp-includes/post-thumbnail-template.php
Advertisement