[wp-trac] [WordPress Trac] #49832: Return value of
WordPress Trac
noreply at wordpress.org
Mon Apr 6 19:39:33 UTC 2020
#49832: Return value of
-----------------------------+-----------------------------
Reporter: theMikeD | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Thumbnails | Version:
Severity: normal | Keywords:
Focuses: docs |
-----------------------------+-----------------------------
Ticket #40096 introduced a new change to the return value of
`get_post_thumbnail_id()` to now always return an int rather than an empty
string if the post is valid. The function documentation is now inaccurate
because the `@return` statement was not updated correctly. In turn, this
means the official API documentation is now also inaccurate.
It currently says
`@return int|string Post thumbnail ID or empty string if the post does not
exist.`
It should read
`@return int|string Post thumbnail ID if found, 0 if the thumbnail image
is not set, or empty string if the post does not exist.`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49832>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list