mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-05 01:30:15 +00:00
Don't use hard-coded indexes when dealing with an array of roles. props elyobo. fixes #19222.
git-svn-id: https://develop.svn.wordpress.org/trunk@21866 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -786,7 +786,7 @@ class WP_User {
|
||||
foreach ( (array) $this->roles as $oldrole )
|
||||
unset( $this->caps[$oldrole] );
|
||||
|
||||
if ( 1 == count( $this->roles ) && $role == $this->roles[0] )
|
||||
if ( 1 == count( $this->roles ) && $role == current( $this->roles ) )
|
||||
return;
|
||||
|
||||
if ( !empty( $role ) ) {
|
||||
|
||||
Reference in New Issue
Block a user