#55249 closed defect (bug) (fixed)
Incorrect return type documented for get_post_custom()
Reported by: | Chouby | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.0 | Priority: | normal |
Severity: | trivial | Version: | 1.2 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
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.
Change History (4)
#1
@
3 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 6.0
- Owner set to audrasjb
- Status changed from new to reviewing
This ticket was mentioned in PR #2356 on WordPress/wordpress-develop by audrasjb.
3 years ago
#2
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/55249
3 years ago
#4
Committed in https://core.trac.wordpress.org/changeset/52795
Note: See
TracTickets for help on using
tickets.
Hey thanks for spotting this @Chouby,
Self-assigning for review and milestoning to 6.0.