[wp-trac] [WordPress Trac] #18948: Introduce $wpdb->delete()

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 20 19:34:00 UTC 2011


#18948: Introduce $wpdb->delete()
-----------------------------+-----------------------------
 Reporter:  scribu           |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Database         |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch early  |
-----------------------------+-----------------------------

Comment (by scribu):

 {{{
 $result = $wpdb->delete( "$wpdb->options" , array( "option_name" =>
 $option) , array( '%s' ) );
 }}}

 should be

 {{{
 $result = $wpdb->delete( "$wpdb->options" , array( "option_name" =>
 $option ) , array( '%s' ) );
 }}}

 ----

 {{{
 function delete( $table, $where, $where_format = null, $limit = null) {
 }}}

 should be

 {{{
 function delete( $table, $where, $where_format = null, $limit = null ) {
 }}}

 ----

 Also, this won't work:

 {{{
 $wpdb->delete( "$wpdb->options" , array( 'option_name' => "REGEXP
 '^rss_[0-9a-f]{32}(_ts)?$'" ) , array( '%s' ) );
 }}}

 REGEXP is a different operator, not a value.

 ----

 {{{
 $wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $id , "meta_key" =>
 "'{$level_key}'" ) , array( '%d' , '%s' ) );
 }}}

 can be

 {{{
 $wpdb->delete( "$wpdb->usermeta" , array( "user_id" => $id , "meta_key" =>
 $level_key ) , array( '%d' , '%s' ) );

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


More information about the wp-trac mailing list