From ad535df32e06bd24c5526bc995ff87a20d35e730 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 21 Sep 2012 13:41:43 +0000 Subject: [PATCH] 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 --- wp-includes/capabilities.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 4d5a6f0fe1..825272354f 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -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 );