[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
Wed Sep 30 23:42:00 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:                |  
--------------------------+-------------------------------------------------

Comment(by dd32):

 I'm still failing to see how this breaks anything, It now abides by what
 it was supposed to do.

 Furthurmore, Peoples plugins SHOULDNT break because of this.

 If you rely upon a false return from the function, as long as you havnt
 used typechecking, it still works, false == '', false == array(),
 empty(before()) == empty(after()), The logic stays the same, With the
 benefit that people can now safely use the function directly in themes (As
 it was originally intended IIRC).

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


More information about the wp-trac mailing list