[wp-trac] [WordPress Trac] #11100: delete_post_meta_by_key() is currently broken

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 8 03:43:44 UTC 2009


#11100: delete_post_meta_by_key() is currently broken
--------------------------+-------------------------------------------------
 Reporter:  Viper007Bond  |       Owner:  ryan      
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Database      |     Version:            
 Severity:  normal        |    Keywords:  has-patch 
--------------------------+-------------------------------------------------
 `$wpdb->prepare()` quotes strings and therefore results in a broken query:

 {{{
 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id
 IN(%s)", implode( ',', $postmetaids) ) );
 }}}

 It results in something like this:

 {{{
 DELETE FROM wp_postmeta WHERE meta_id
 IN('883,1062,1063,1064,1066,1067,969')
 }}}

 There are likely other places where this is also an issue.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11100>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list