Changeset 38768 for trunk/src/wp-includes/class-wp-roles.php
- Timestamp:
- 10/10/2016 06:37:02 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-roles.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-roles.php
r38387 r38768 71 71 72 72 /** 73 * @since 4.7.074 * @access protected75 * @var wpdb76 */77 protected $db;78 79 /**80 73 * Constructor 81 74 * … … 83 76 */ 84 77 public function __construct() { 85 $this->db = $GLOBALS['wpdb'];86 87 78 $this->_init(); 88 79 } … … 118 109 */ 119 110 protected function _init() { 120 global $wp_user_roles; 121 $this->role_key = $this->db->get_blog_prefix() . 'user_roles'; 111 global $wp_user_roles, $wpdb; 112 113 $this->role_key = $wpdb->get_blog_prefix() . 'user_roles'; 122 114 if ( ! empty( $wp_user_roles ) ) { 123 115 $this->roles = $wp_user_roles; … … 148 140 */ 149 141 public function reinit() { 142 global $wpdb; 143 150 144 // There is no need to reinit if using the wp_user_roles global. 151 145 if ( ! $this->use_db ) { … … 154 148 155 149 // Duplicated from _init() to avoid an extra function call. 156 $this->role_key = $ this->db->get_blog_prefix() . 'user_roles';150 $this->role_key = $wpdb->get_blog_prefix() . 'user_roles'; 157 151 $this->roles = get_option( $this->role_key ); 158 152 if ( empty( $this->roles ) )
Note: See TracChangeset
for help on using the changeset viewer.