Ticket #40320: 40320.patch
File 40320.patch, 1.3 KB (added by , 7 years ago) |
---|
-
wp-includes/capabilities.php
677 677 } 678 678 679 679 /** 680 * Rename an existing role. 681 * 682 * @since 4.8.0 683 * 684 * @param string $role Role slug. 685 * @param string $new_name New role name. 686 */ 687 function rename_role( $role, $new_name ) { 688 wp_roles()->rename_role( $role, $new_name ); 689 } 690 691 /** 680 692 * Retrieve a list of super admins. 681 693 * 682 694 * @since 3.0.0 -
wp-includes/class-wp-roles.php
209 209 } 210 210 211 211 /** 212 * Rename an existing role. 213 * 214 * @since 4.8.0 215 * 216 * @param string $role Role slug. 217 * @param string $new_name New role name. 218 */ 219 public function rename_role( $role, $new_name ) { 220 if ( ! isset( $this->role_objects[ $role ] ) ) 221 return; 222 223 $this->role_objects[ $role ]->name = $new_name; 224 $this->role_names[ $role ] = $new_name; 225 $this->roles[ $role ]['name'] = $new_name; 226 227 if ( $this->use_db ) 228 update_option( $this->role_key, $this->roles ); 229 } 230 231 /** 212 232 * Add capability to role. 213 233 * 214 234 * @since 2.0.0