Allow remove_cap() to unset a negative capability. Props johnjamesjacoby. fixes #21786

git-svn-id: https://develop.svn.wordpress.org/trunk@21940 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-09-21 13:41:43 +00:00
parent 2c8fd31155
commit ad535df32e
1 changed files with 1 additions and 1 deletions

View File

@ -868,7 +868,7 @@ class WP_User {
* @param string $cap Capability name.
*/
function remove_cap( $cap ) {
if ( empty( $this->caps[$cap] ) )
if ( ! isset( $this->caps[$cap] ) )
return;
unset( $this->caps[$cap] );
update_user_meta( $this->ID, $this->cap_key, $this->caps );