Change user metadata on registration (show_admin_bar_front = false)

If you want to update meta on registration like this I think a better option would be to use the register_new_user hook with add_action. https://developer.wordpress.org/reference/hooks/register_new_user/ So something like: add_action(‘register_new_user’,’my_update_meta’,10,1); function my_update_meta($user_id){ update_user_meta($user_id, ‘show_admin_bar_front’, false); } If in doubt, hooks/filters/actions tend to be the best option for WordPress work.

profile_update works on second update only

Not long after posing this question I figured it out. But since I had spent a few hours looking for the awswer I thought maybe it would be worth posting. I hope this does not break any rules. I changed the default priority from 10 to 11. as per: add_action( ‘profile_update’, ‘initiate_participant_profile_update’, 10, 2 ); … Read more

Get UserInfo from WordPress

Since you’re using a JWT for the current user (that is logged into WordPress), you can use this endpoint: /wp/v2/users/me https://developer.wordpress.org/rest-api/reference/users/#retrieve-a-user-2 You can also check the token to see what claims are available at https://jwt.ms

wp_redirect not working after update_user_meta

wp_redirect sends a HTTP header to the browser. Once HTTP headers are sent, that’s it, they’re gone, you can’t add anymore. However, you called get_header and rendered some HTML. To do this headers need to be sent to the browser telling it to expect a HTML page. So by the time you load edit-profile-proccess.php, it’s … Read more