From a9bf2e7aaa50f4d81be4c54b3952b654e8b51b43 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Sun, 6 Dec 2015 20:09:50 +0000 Subject: [PATCH] Multisite: Add hook before a new user is created during the creation of a new site. New `network_site_new_created_user_pending` action fires before a new user will be created via the network site-new.php page. Props mackensen Fixes #33631 git-svn-id: https://develop.svn.wordpress.org/trunk@35786 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/network/site-new.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wp-admin/network/site-new.php b/src/wp-admin/network/site-new.php index dac11614a4..83254da848 100644 --- a/src/wp-admin/network/site-new.php +++ b/src/wp-admin/network/site-new.php @@ -90,6 +90,15 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { $password = 'N/A'; $user_id = email_exists($email); if ( !$user_id ) { // Create a new user with a random password + /** + * Fires when a new user will be created via the network site-new.php page. + * + * @since 4.5.0 + * + * @param string $email Email of the non-existent user. + */ + do_action( 'network_site_new_created_user_pending', $email ); + $user_id = username_exists( $domain ); if ( $user_id ) { wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );