Display a custom name when the user has no name settle in his account

Use PHP ternary comparsion operator to check if get_user_meta() function returns blank or non-blank result: function colaborador_nome($atts) { if (is_user_logged_in() && !is_feed()) { return ‘&nbsp;’. (get_user_meta( get_current_user_id(), ‘first_name’, true ) ?: “Hi >No Name<, please settle your name in your account.”); } } add_shortcode(‘colaborador_nome’, ‘colaborador_nome’);

How to add @ symbol to user url

There’s no such thing as a literal @ in that part of a URL, you have to URL encode it. Sometimes browsers will decode it for you so it looks ok but it’s just being helpful. The only time you can use it without encoding is when specifying the username and password in a URL … Read more

How to recover lost username?

There are a few easy steps to take: Go to your host management panel (GoDaddy docs here) and open phpMyAdmin. Navigate to your WordPress installation database Navigate to the wp_users table and you will see all of your users and email information Go to your WP installation login screen and reset your password there with … Read more

php return username of currently viewed author profile

On an author archive page (assuming the plugin uses the core archives) get_queried_object() will return the WP_User object for the author. Something like: $author = get_queried_object(); if (is_a($author, ‘WP_User’)) { var_dump($author->data); } You should see the login, nicename, and display name in there. Use what you need.

I want to change my user name

How friendly are you with databases? The simpliest way is to change it in database directly. You need to check table WP_users and WP_users meta. Everything else is according to ID of that user and gravatar is checking your email so there is no problem in changeing it in database. Unfortunately you can’t do it … Read more