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

git-svn-id: http://core.svn.wordpress.org/trunk@21940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-09-21 13:41:43 +00:00
parent df21fa1cc6
commit ba84c90e1b
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 );