One Lock, One Key: Why a WordPress Login Breaks From a Single Wrong Return
The Problem A developer adds a custom check to the authenticate filter — say, blocking login for users with an unverified email. The simplest approach: return false if…

Action Hook since 2.0.0
Fires immediately after a new user is registered
user_register fires right after wp_insert_user() writes the row — the account exists but you're still inside the registration request, which matters for redirects and emails.
Inside wp_insert_user(), after the user row and default meta are written.
do_action( 'user_register', int $user_id, array $userdata );$user_id int — ID of the newly registered user.$userdata array — Raw array of user data used to create the account.add_action( 'user_register', function( $user_id ) {
$user = new WP_User( $user_id );
$user->set_role( 'subscriber' );
wp_mail( $user->user_email, 'Welcome!', 'Thanks for registering.' );
} );Assign a default role and send a welcome email on signup.
The Problem A developer adds a custom check to the authenticate filter — say, blocking login for users with an unverified email. The simplest approach: return false if…
Yes — any path that goes through wp_insert_user() triggers it, including admin-created accounts and REST API user creation.
Source: wp-includes/user.php
One session: this hook, then each related_hooks entry. Walk it and tell us what to change.
user_register → wp_login
Practice the user_register WordPress action hook in our interactive sandbox — a VS Code-style editor with a step-by-step user_register tutorial, add_action exercises, and instant feedback. No local WordPress install required.