#40519 closed enhancement (fixed)
Document that get_metadata() returns false for bad parameters
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 4.8 |
Component: | Options, Meta APIs | Keywords: | has-patch needs-refresh |
Focuses: | docs | Cc: |
Description
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)
Change History (6)
This ticket was mentioned in Slack in #core by noisysocks. View the logs.
5 years ago
#3
@
5 years ago
- Component changed from General to Options, Meta APIs
- Keywords needs-refresh added
- Milestone changed from Awaiting Review to Future Release
Hi @salcode!
Apologies for the very slow reply on this, and thanks much for your work and patch.
We chatted about this ticket in today's ticket triage.
It looks like these changes would still help make the documentation clearer, but unfortunately the patch doesn't apply anymore.
If you, or anyone else, has a chance to refresh the patch, it would be much appreciated.
Here is the [GitHub branch](https://github.com/salcode/wordpress-develop/tree/sf/get-metadata-doc-40519) where I've made this change.