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