revoke_super_admin
Action HookDescription
Fires before the user's Super Admin privileges are revoked.Hook Information
File Location |
wp-includes/capabilities.php
View on GitHub
|
Hook Type | Action |
Line Number | 1250 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$user_id
|
ID of the user Super Admin privileges are being revoked from. |
Usage Examples
Basic Usage
<?php
// Hook into revoke_super_admin
add_action('revoke_super_admin', 'my_custom_function', 10, 1);
function my_custom_function($user_id) {
// Your custom code here
}
Source Code Context
wp-includes/capabilities.php:1250
- How this hook is used in WordPress core
<?php
1245 *
1246 * @since 3.0.0
1247 *
1248 * @param int $user_id ID of the user Super Admin privileges are being revoked from.
1249 */
1250 do_action( 'revoke_super_admin', $user_id );
1251
1252 // Directly fetch site_admins instead of using get_super_admins().
1253 $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
1254
1255 $user = get_userdata( $user_id );
PHP Documentation
<?php
/**
* Fires before the user's Super Admin privileges are revoked.
*
* @since 3.0.0
*
* @param int $user_id ID of the user Super Admin privileges are being revoked from.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/capabilities.php
Related Hooks
Related hooks will be displayed here in future updates.