WordPress.org

Make WordPress Core

Changeset 28305


Ignore:
Timestamp:
05/06/2014 05:26:47 PM (7 years ago)
Author:
wonderboymusic
Message:

In wp-admin/includes/upgrade.php, remove dead code:

  • In maybe_create_table() and maybe_add_column(), the response of $wpdb->query() is set to a variable that is never used.
  • In make_db_current_silent(), which is a wrapper for dbDelta, a variable is set that is not used. This function appears to be a copy-paste of make_db_current()'s dbDelta() call but is meant to return nothing, and still does not.

See #27882.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r27998 r28305  
    13861386        return true;
    13871387    //didn't find it try to create it.
    1388     $q = $wpdb->query($create_ddl);
     1388    $wpdb->query($create_ddl);
    13891389    // we cannot directly tell that whether this succeeded!
    13901390    if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )
     
    14481448    }
    14491449    //didn't find it try to create it.
    1450     $q = $wpdb->query($create_ddl);
     1450    $wpdb->query($create_ddl);
    14511451    // we cannot directly tell that whether this succeeded!
    14521452    foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
     
    15561556        $queries = array_filter( $queries );
    15571557    }
    1558    
    1559     /** 
     1558
     1559    /**
    15601560     * Filter the dbDelta SQL queries.
    15611561     *
     
    15851585        }
    15861586    }
    1587    
    1588     /** 
     1587
     1588    /**
    15891589     * Filter the dbDelta SQL queries for creating tables and/or databases.
    15901590     *
    15911591     * Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE".
    1592      * 
     1592     *
    15931593     * @since 3.3.0
    15941594     *
     
    15971597    $cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );
    15981598
    1599     /** 
     1599    /**
    16001600     * Filter the dbDelta SQL queries for inserting or updating.
    16011601     *
    16021602     * Queries filterable via this hook contain "INSERT INTO" or "UPDATE".
    1603      * 
     1603     *
    16041604     * @since 3.3.0
    16051605     *
     
    17951795 */
    17961796function make_db_current_silent( $tables = 'all' ) {
    1797     $alterations = dbDelta( $tables );
     1797    dbDelta( $tables );
    17981798}
    17991799
Note: See TracChangeset for help on using the changeset viewer.