WordPress.org

Make WordPress Core

Ticket #18932: 18932.diff

File 18932.diff, 629 bytes (added by scribu, 3 years ago)
  • wp-includes/capabilities.php

    diff --git wp-includes/capabilities.php wp-includes/capabilities.php
    index b93e2a8..69d637c 100644
    class WP_User { 
    718718         * @param string $role Role name. 
    719719         */ 
    720720        function set_role( $role ) { 
    721                 foreach ( (array) $this->roles as $oldrole ) 
    722                         unset( $this->caps[$oldrole] ); 
    723  
    724721                if ( 1 == count( $this->roles ) && $role == $this->roles[0] ) 
    725722                        return; 
    726723 
     724                foreach ( (array) $this->roles as $oldrole ) 
     725                        unset( $this->caps[$oldrole] ); 
     726 
    727727                if ( !empty( $role ) ) { 
    728728                        $this->caps[$role] = true; 
    729729                        $this->roles = array( $role => true );