WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/24/2012 03:24:31 PM (8 years ago)
Author:
nacin
Message:

Introduce $wpdb->delete(). props justindgivens, scribu. fixes #18948.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r20101 r20287  
    497497        // If registered more than two days ago, cancel registration and let this signup go through.
    498498        if ( $diff > 172800 )
    499             $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->signups WHERE user_login = %s", $user_name) );
     499            $wpdb->delete( $wpdb->signups, array( 'user_login' => $user_name ) );
    500500        else
    501501            $errors->add('user_name', __('That username is currently reserved but may be available in a couple of days.'));
     
    510510        // If registered more than two days ago, cancel registration and let this signup go through.
    511511        if ( $diff > 172800 )
    512             $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->signups WHERE user_email = %s", $user_email) );
     512            $wpdb->delete( $wpdb->signups, array( 'user_email' => $user_email ) );
    513513        else
    514514            $errors->add('user_email', __('That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.'));
     
    613613        // If registered more than two days ago, cancel registration and let this signup go through.
    614614        if ( $diff > 172800 )
    615             $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path) );
     615            $wpdb->delete( $wpdb->signups, array( 'domain' => $mydomain , 'path' => $path ) );
    616616        else
    617617            $errors->add('blogname', __('That site is currently reserved but may be available in a couple days.'));
     
    11611161
    11621162    // remove all perms
    1163     $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE meta_key = %s", $table_prefix.'user_level') );
    1164     $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE meta_key = %s", $table_prefix.'capabilities') );
     1163    $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $table_prefix.'user_level' ) );
     1164
     1165    $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $table_prefix.'capabilities' ) );
    11651166
    11661167    $wpdb->suppress_errors( false );
Note: See TracChangeset for help on using the changeset viewer.