WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/19/2010 07:57:03 PM (10 years ago)
Author:
nacin
Message:

Introduce wpdb::tables() to fetch table names on a global or blog scope. Remove very old and long deprecated $table{table} globals, fixes #11614. See #12083

File:
1 edited

Legend:

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

    r13210 r13229  
    18281828    $wpdb->suppress_errors( $suppress );
    18291829
     1830    $wp_tables = $wpdb->tables( 'all', true );
    18301831    // Loop over the WP tables.  If none exist, then scratch install is allowed.
    18311832    // If one or more exist, suggest table repair since we got here because the options
    18321833    // table could not be accessed.
    1833     foreach ($wpdb->tables as $table) {
     1834    foreach ( $wp_tables as $table ) {
    18341835        // If one of the WP tables exist, then we are in an insane state.
    1835         if ( in_array($wpdb->prefix . $table, $tables) ) {
     1836        if ( in_array( $table, $tables ) ) {
    18361837            // If visiting repair.php, return true and let it take over.
    18371838            if ( defined('WP_REPAIRING') )
Note: See TracChangeset for help on using the changeset viewer.