Make WordPress Core

Ticket #2512: alternate_options_table.diff

File alternate_options_table.diff, 1.3 KB (added by markjaquith, 19 years ago)
  • wp-includes/capabilities.php

     
    1313
    1414                $this->roles = get_option($this->role_key);
    1515
    16                 if ( empty($this->roles) )
    17                         return;
     16                if ( empty($this->roles) ) {
     17                        if ( $table_prefix != substr($wpdb->options, 0, strlen($wpdb->options) - 7) ) {
     18                                // we're using a custom options table, but our roles are set in the normal options table
     19                                $this->roles = $wpdb->get_var("SELECT option_value FROM" . $tableprefix . "options WHERE option_name = '$this->role_key'");
     20                        }
     21                        if ( empty($this->roles) )
     22                                return;
     23                }
    1824
    1925                foreach ($this->roles as $role => $data) {
    2026                        $this->role_objects[$role] = new WP_Role($role, $this->roles[$role]['capabilities']);
  • wp-settings.php

     
    9191        $wpdb->users = CUSTOM_USER_TABLE;
    9292if ( defined('CUSTOM_USER_META_TABLE') )
    9393        $wpdb->usermeta = CUSTOM_USER_META_TABLE;
     94if ( defined('CUSTOM_OPTIONS_TABLE') )
     95        $wpdb->options = CUSTOM_OPTIONS_TABLE;
    9496
    9597// We're going to need to keep this around for a few months even though we're not using it internally
    9698