Changeset 39082 for trunk/src/wp-includes/class-wp-roles.php
- Timestamp:
- 11/02/2016 12:30:29 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-roles.php
r38768 r39082 128 128 $this->role_names[$role] = $this->roles[$role]['name']; 129 129 } 130 131 /** 132 * After the roles have been initialized, allow plugins to add their own roles. 133 * 134 * @since 4.7.0 135 * 136 * @param WP_Roles A reference to the WP_Roles object. 137 */ 138 do_action( 'wp_roles_init', $this ); 130 139 } 131 140 … … 137 146 * 138 147 * @since 3.5.0 148 * @deprecated 4.7.0 Use new WP_Roles() 139 149 * @access public 140 150 */ 141 151 public function reinit() { 142 global $wpdb; 143 144 // There is no need to reinit if using the wp_user_roles global. 145 if ( ! $this->use_db ) { 146 return; 147 } 148 149 // Duplicated from _init() to avoid an extra function call. 150 $this->role_key = $wpdb->get_blog_prefix() . 'user_roles'; 151 $this->roles = get_option( $this->role_key ); 152 if ( empty( $this->roles ) ) 153 return; 154 155 $this->role_objects = array(); 156 $this->role_names = array(); 157 foreach ( array_keys( $this->roles ) as $role ) { 158 $this->role_objects[$role] = new WP_Role( $role, $this->roles[$role]['capabilities'] ); 159 $this->role_names[$role] = $this->roles[$role]['name']; 160 } 152 __deprecated_function( __METHOD__, '4.7.0', 'new WP_Roles()' ); 153 $this->_init(); 161 154 } 162 155
Note: See TracChangeset
for help on using the changeset viewer.