Make WordPress Core

Changeset 13337


Ignore:
Timestamp:
02/23/2010 07:58:53 PM (17 years ago)
Author:
nacin
Message:

Ensure we have MS global tables defined during network install. See #11644

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network.php

    r13025 r13337  
    1616if ( ! is_super_admin() )
    1717        wp_die( __( 'You do not have sufficient permissions to manage options for this blog.' ) );
     18
     19// We need to create references to ms global tables to enable Network.
     20foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table )
     21        $wpdb->$table = $prefixed_table;
    1822
    1923$title = __( 'Network Settings' );
  • trunk/wp-includes/wp-db.php

    r13327 r13337  
    626626         * @uses is_multisite()
    627627         *
    628          * @param string $scope Can be all, global, blog, or old tables. Default all.
     628         * @param string $scope Can be all, global, ms_global, blog, or old tables. Default all.
    629629         *      All returns the blog tables for the queried blog and all global tables.
    630630         * @param bool $prefix Whether to include table prefixes. Default true. If blog
    631631         *      prefix is requested, then the custom users and usermeta tables will be mapped.
    632632         * @param int $blog_id The blog_id to prefix. Defaults to main blog. Used only when prefix is requested.
    633          * @return array Table names. When a prefix is requested, the key is the
    634          *      unprefixed table name.
     633         * @return array Table names. When a prefix is requested, the key is the unprefixed table name.
    635634         */
    636635        function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) {
    … …  
    641640                        case 'blog' :
    642641                                $tables = $this->tables;
     642                                break;
     643                        case 'ms_global' :
     644                                $tables = $this->ms_global_tables;
    643645                                break;
    644646                        case 'global' :
Note: See TracChangeset for help on using the changeset viewer.