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

How to change the URL of sub menu page?

As per the requirement in the comments, one way to do that rewrite is with .htaccess. This may be possible with WordPress rewrite functions too, but I find .htaccess easier as there are some constraints with the WordPress functions. If your WordPress installation is at http://localhost/wordpress then your .htaccess should be in the wordpress directory. … Read more

How to display content if user meta data isn’t empty with shortcode

Your shortcode can look like this: [check-if-empty usermeta=”last_name”] Is not empty [/check-if-empty] The parameter called “usermeta” is added to your function ($atts) and it’s value is used to check the userdata. function func_check_if_empty( $atts, $content = null ) { if ( is_user_logged_in() ) { /* check if logged in */ $user_meta = $atts[‘usermeta’]; /* get … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)