functions.php: add hook to prevent multisite signup

This commit is contained in:
Silvan Calarco 2023-08-21 10:51:40 +02:00
parent ba1254a768
commit 0a060e1c8a

View File

@ -448,3 +448,11 @@ function user_registration_filter($user_id, $email) {
return $user_id; return $user_id;
} }
add_filter('email_exists', 'user_registration_filter', 10, 2); add_filter('email_exists', 'user_registration_filter', 10, 2);
/* Security: prevent multisite signup */
function prevent_multisite_signup()
{
wp_redirect( site_url() );
die();
}
add_action( 'signup_header', 'prevent_multisite_signup' );