[wp-trac] [WordPress Trac] #40519: Document that get_metadata() returns false for bad parameters

WordPress Trac noreply at wordpress.org
Fri Apr 21 18:55:18 UTC 2017


#40519: Document that get_metadata() returns false for bad parameters
-------------------------+-----------------------------
 Reporter:  salcode      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:  docs         |
-------------------------+-----------------------------
 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()}}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40519>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list