remove_user_role

remove_user_role

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('remove_user_role') is found 2 times:

  • /wp-includes/class-wp-user.php line 595
    		 *
    		 * @param int    $user_id The user ID.
    		 * @param string $role    The removed role.
    		 */
    		do_action( 'remove_user_role', $this->ID, $role );
    	}
    
    	/**
    	 * Sets the role of the user.
    	 *
    	 * This will remove the previous roles of the user and assign the user the
    
  • /wp-includes/class-wp-user.php line 637
    				continue;
    			}
    
    			/** This action is documented in wp-includes/class-wp-user.php */
    			do_action( 'remove_user_role', $this->ID, $old_role );
    		}
    
    		if ( $role && ! in_array( $role, $old_roles, true ) ) {
    			/** This action is documented in wp-includes/class-wp-user.php */
    			do_action( 'add_user_role', $this->ID, $role );
    		}
    

See this hook used in plugins: