Changing the register url is not working

First, make sure you have a Page set up with the slug “join”. This page must exist if you expect to point visitors there. Second, using this filter will NOT redirect you to the /join/ page when you directly visit wp-login.php. It only replaces the URL WordPress uses when generating links/URLs to the default signup … Read more

Update a user field with a generated text

Your hook already gives you user id, you don’t need to $current_user. add_action (‘user_register’, ‘mailboxNumberGenerator’, 10, 1); function mailboxNumberGenerator($user_id) { $initialMailboxNum = 100000; $user_query = new WP_User_Query( array( ‘role’ => ‘Customer’ ) ); $user_query2 = new WP_User_Query( array( ‘role’ => ‘Subscriber’ ) ); $currentMailboxNum = $initialMailboxNum + $user_query->get_total() + $user_query2->get_total(); $newMailboxNum = $currentMailboxNum + 1; … Read more