Take the following steps to implement email activation for new user account registrations:
- Open the wpcookbookchapter5.php file of the WPCookbook Chapter 5 plugin in the code editor.
- Add the following code block to implement the user_register action with a callback function:
add_action( 'user_register', 'wpccp_chapter5_add_registration_data', 10, 1 );function wpccp_chapter5_add_registration_data( $user_id ) { // Step 3 code }
- Add the following code block inside the function to check the user activation status of the registered users:
$activation_status = get_user_meta($user_id, 'wpccp_user_activation_status',true); if( trim($activation_status) == '' ){ // Step 4 code }
- Add the following code inside the if statement ...