Make WordPress Core

Changeset 15919


Ignore:
Timestamp:
10/22/2010 07:38:20 PM (14 years ago)
Author:
ryan
Message:

Do not set role if it is the same. Props nickmomrik. fixes #14708

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r15891 r15919  
    606606        foreach ( (array) $this->roles as $oldrole )
    607607            unset( $this->caps[$oldrole] );
     608
     609        if ( 1 == count( $this->roles ) && $role == $this->roles[0] )
     610            return;
     611
    608612        if ( !empty( $role ) ) {
    609613            $this->caps[$role] = true;
Note: See TracChangeset for help on using the changeset viewer.