V
V
Vadim Sverdlik2021-12-29 22:30:44
WordPress
Vadim Sverdlik, 2021-12-29 22:30:44

What is the hook in WP to wrap the event in it immediately upon registration?

Tell me a hook in WP in order to immediately wrap an event in it upon registration? The bottom line is that the check will be on whether the user has logged into his personal account and whether he is subscribed to the mailing list, but after all, these 2 events can fire many times, but it is necessary during registration, that is, as soon as you register, there will be a check

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Radiks Alijevs, 2022-01-07
@dedalik

There is a ready-made Wordpress hook that fires as a new user has been registered on the site. More details here https://wp-kama.ru/hook/user_register
You can use something like this:

add_action( 'user_register', 'registration_save', 10, 1 );
 
function registration_save( $user_id ) {
 
    if ( isset( $_POST['first_name'] ) )
        update_user_meta($user_id, 'first_name', $_POST['first_name']);
 
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question