mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-06 05:34:26 +00:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user