WordPress.org

Make WordPress Core

Ticket #49102: 0001-Add-removed_user_from_blog-action-hook.patch

File 0001-Add-removed_user_from_blog-action-hook.patch, 1.1 KB (added by kevinu, 3 months ago)

Patch file for changes to add this hook

  • src/wp-includes/ms-functions.php

    From 76f7cdf54e3ee371bf9523ee48c1c6c160b49cfd Mon Sep 17 00:00:00 2001
    From: Kevin Ullyott <ullyott.kevin@gmail.com>
    Date: Mon, 30 Dec 2019 17:22:06 -0800
    Subject: [PATCH] Add removed_user_from_blog action hook
    
    Adds an action hook to remove_user_from_blog for after the succesful removal of a user from a blog
    
    Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
    ---
     src/wp-includes/ms-functions.php | 12 +++++++++++-
     1 file changed, 11 insertions(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php
    index 43325c0cac..1606faa944 100644
    a b function remove_user_from_blog( $user_id, $blog_id = '', $reassign = '' ) { 
    303303                }
    304304        }
    305305
    306         restore_current_blog();
     306    /**
     307         * Fires after a user is removed from a site.
     308         *
     309         * @since MU (5.3.0)
     310         *
     311         * @param int $user_id User ID.
     312         * @param int $blog_id Blog ID.
     313         */
     314    do_action( 'removed_user_from_blog', $user_id, $blog_id );
     315
     316    restore_current_blog();
    307317
    308318        return true;
    309319}