Ticket #16617: get_role_diff.patch
File get_role_diff.patch, 1.1 KB (added by , 14 years ago) |
---|
-
wp-includes/capabilities.php
204 204 * 205 205 * @since 2.0.0 206 206 * @access public 207 * @static 207 208 * 208 209 * @param string $role Role name. 209 210 * @return object|null Null, if role does not exist. WP_Role object, if found. 210 211 */ 211 212 function &get_role( $role ) { 212 if ( isset( $this->role_objects[$role] ) ) 213 return $this->role_objects[$role]; 213 global $wp_roles; 214 215 if ( ! isset( $wp_roles ) ) 216 $wp_roles = new WP_Roles(); 217 218 if ( isset( $wp_roles->role_objects[$role] ) ) 219 return $wp_roles->role_objects[$role]; 214 220 else 215 221 return null; 216 222 } … … 1114 1120 * 1115 1121 * @see WP_Roles::get_role() Uses method to retrieve role object. 1116 1122 * @since 2.0.0 1123 * @depricated 1117 1124 * 1118 1125 * @param string $role Role name. 1119 1126 * @return object 1120 1127 */ 1121 1128 function get_role( $role ) { 1122 global $wp_roles; 1123 1124 if ( ! isset( $wp_roles ) ) 1125 $wp_roles = new WP_Roles(); 1126 1127 return $wp_roles->get_role( $role ); 1129 return WP_Roles::get_role( $role ); 1128 1130 } 1129 1131 1130 1132 /**