[wp-trac] Re: [WordPress Trac] #7018: update_post_meta should add nonexistent values

WordPress Trac wp-trac at lists.automattic.com
Tue May 27 06:22:56 GMT 2008


#7018: update_post_meta should add nonexistent values
------------------------------+---------------------------------------------
 Reporter:  filosofo          |        Owner:  anonymous
     Type:  defect            |       Status:  reopened 
 Priority:  normal            |    Milestone:  2.6      
Component:  General           |      Version:  2.5      
 Severity:  normal            |   Resolution:           
 Keywords:  update_post_meta  |  
------------------------------+---------------------------------------------
Changes (by azaozz):

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

Comment:

 Using update_post_meta() instead of add_post_meta() converts the array of
 attachment properties to a string when uploading new image. That results
 in php warnings on the Media Library page.

 The patch slightly optimizes update_post_meta() and ensures it calls
 add_post_meta() when the key doesn't exist.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7018#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list