[wp-trac] [WordPress Trac] #55249: Incorrect return type documented for get_post_custom()
WordPress Trac
noreply at wordpress.org
Thu Feb 24 14:53:53 UTC 2022
#55249: Incorrect return type documented for get_post_custom()
-------------------------------+-----------------------------
Reporter: Chouby | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 1.2
Severity: trivial | Keywords:
Focuses: docs |
-------------------------------+-----------------------------
In the doc block of `get_post_custom()`, we can read that it always return
an array. This is incorrect. As the return value is directly coming from
`get_post_meta()`, the function can return, according to the doc of
`get_post_meta()`
- An array of values
- False for an invalid `$post_id` (non-numeric, zero, or negative value).
- An empty string if a valid but non-existing post ID is passed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55249>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list