Action hook 'remove_user_from_blog'

in WP Core File wp-includes/ms-functions.php at line 257

View Source

remove_user_from_blog

Action Hook
Description
Fires before a user is removed from a site.

Hook Information

File Location wp-includes/ms-functions.php View on GitHub
Hook Type Action
Line Number 257

Hook Parameters

Type Name Description
int $user_id ID of the user being removed.
int $blog_id ID of the blog the user is being removed from.
int $reassign ID of the user to whom to reassign posts.

Usage Examples

Basic Usage
<?php
// Hook into remove_user_from_blog
add_action('remove_user_from_blog', 'my_custom_function', 10, 3);

function my_custom_function($user_id, $blog_id, $reassign) {
    // Your custom code here
}

Source Code Context

wp-includes/ms-functions.php:257 - How this hook is used in WordPress core
<?php
 252  	 *
 253  	 * @param int $user_id  ID of the user being removed.
 254  	 * @param int $blog_id  ID of the blog the user is being removed from.
 255  	 * @param int $reassign ID of the user to whom to reassign posts.
 256  	 */
 257  	do_action( 'remove_user_from_blog', $user_id, $blog_id, $reassign );
 258  
 259  	/*
 260  	 * If being removed from the primary blog, set a new primary
 261  	 * if the user is assigned to multiple blogs.
 262  	 */

PHP Documentation

<?php
/**
	 * Fires before a user is removed from a site.
	 *
	 * @since MU (3.0.0)
	 * @since 5.4.0 Added the `$reassign` parameter.
	 *
	 * @param int $user_id  ID of the user being removed.
	 * @param int $blog_id  ID of the blog the user is being removed from.
	 * @param int $reassign ID of the user to whom to reassign posts.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/ms-functions.php
Related Hooks

Related hooks will be displayed here in future updates.