[wp-trac] [WordPress Trac] #10803: get_post_meta doesn't return an array when requested if nothing with that key exists.

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 29 20:32:31 UTC 2009


#10803: get_post_meta doesn't return an array when requested if nothing with that
key exists.
--------------------------+-------------------------------------------------
 Reporter:  westi         |        Owner:  westi 
     Type:  defect (bug)  |       Status:  closed
 Priority:  normal        |    Milestone:  2.9   
Component:  General       |      Version:  2.8.4 
 Severity:  normal        |   Resolution:  fixed 
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by westi):

  * status:  reopened => closed
  * resolution:  => fixed


Comment:

 Replying to [comment:10 Denis-de-Bernardy]:
 > Nonetheless, after a certain amount of time bugs tend to become
 features, and this is a regression.
 >

 In some cases yes.  In this case I disagree - the bug is clear and obvious
 and should be fixed so that the function respects its arguments.


 Replying to [comment:11 azaozz]:
 > Having a default value is a 'convenience' for APIs that store and
 retrieve something. It usually saves one conditional. Instead of doing:

 Agreed, they are a convenience although I'm not sure they are useful for
 80% of the uses of *_meta where we are storing meta data about a post.

 Anyway - they are the subject for a new ticket rather than re-using a
 specific bug ticket which has been fixed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10803#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list