Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#40519 new enhancement

Document that get_metadata() returns false for bad parameters

Reported by: salcode Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: General Keywords: has-patch
Focuses: docs Cc:
PR Number:


Currently the inline documentation for the return value for get_metadata() reads

@return mixed Single metadata value, or array of values

I've noticed that if you pass in a post id of zero, you get a value of false. While the value of false falls under the category of "mixed", I would like to see it mentioned explicitly.

If we make this change, we should do the same for any function that uses get_metadata(), e.g. get_post_meta()

Attachments (1)

40519.diff (4.2 KB) - added by salcode 3 years ago.

Download all attachments as: .zip

Change History (2)

3 years ago

#1 @salcode
3 years ago

  • Keywords has-patch added

Here is the [GitHub branch](https://github.com/salcode/wordpress-develop/tree/sf/get-metadata-doc-40519) where I've made this change.

Note: See TracTickets for help on using tickets.