[wp-trac] [WordPress Trac] #49832: Documented @return for get_post_thumbnail_id() is inaccurate

WordPress Trac noreply at wordpress.org
Sun Jul 5 10:15:55 UTC 2020


#49832: Documented @return for get_post_thumbnail_id() is inaccurate
-----------------------------+-----------------------------
 Reporter:  theMikeD         |       Owner:  SergeyBiryukov
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:  5.5
Component:  Post Thumbnails  |     Version:
 Severity:  normal           |  Resolution:  fixed
 Keywords:  has-patch        |     Focuses:  docs
-----------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"48310" 48310]:
 {{{
 #!CommitTicketReference repository="" revision="48310"
 Post Thumbnails: Change the return value of `get_post_thumbnail_id()` for
 a non-existing post to `false` instead of an empty string.

 This further makes the function more consistent with `get_the_ID()` or
 `wp_get_post_parent_id()`, both returning `false` for a non-existing post.

 Additionally, document that `get_post_thumbnail_id()` returns `0` if the
 thumbnail image is not set.

 Follow-up to [47160].

 Props theMikeD, dingo_d, netpassprodsr, SergeyBiryukov.
 Fixes #49832. See #40096.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49832#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list