I am trying to show the name of the currently logged-in user in a small text like 'Hello, username!'. I tried to do this, but it doesn't work: <p class="vam"> <?php if(is_user_logged_in()): $current_user = wp_get_current_user(); ?> Hello, <b><?php echo $current_user->display_name; ?></b>! <?php else:?> Hello, <span>Client</span>!`
I am currently calling a user's nicename in a function I have: $users = $user_query->get_results(); foreach( $users as $user ): echo $user->user_nicename; I'm trying to call the user's Nickname instead, but nothing I do is working such as: echo $user->user_nickname; Is there a special way you have to call a user's nickname? Thanks
I'm just wondering about usernames... Why isn't is possible to change this through Wordpress API? (I understand why a user in the admin dashboard can't change username(s) but that isn't really same thing!?) Code below does just ignore the user_login - setting. $pupil_obj= get_post($postid_pupil); $user_login = $pupil_obj->post_name; $user_nicename = $pupil_obj->post_name; $user_args = array( 'ID' => $current_user->ID, 'user_email' => $email, 'user_login' => $user_login, 'user_nicename' => $user_nicename ); wp_update_user( $user_args ) ; I could update the username to the database directly through …
I want to add the @ symbol to the beginning of the username in the url i find this code to remove author from url But I do not know how I should change to add @ to the beginning of the usernames and the address will be @authorname or @nickname // The first part // add_filter('author_rewrite_rules', 'no_author_base_rewrite_rules'); function no_author_base_rewrite_rules($author_rewrite) { global $wpdb; $author_rewrite = array(); $authors = $wpdb->get_results("SELECT user_nicename AS nicename from $wpdb->users"); foreach($authors as $author) { $author_rewrite["({$author->nicename})/page/?([0-9]+)/?$"] = …
I have a WooCommerce module creating Wordpress usernames on my behalf. I want to make sure those usernames are sanitized according to my rules, which are stricter than the Wordpress requirements. How can I hook / override sanitize_user to use my custom rules?
Im having problem with usernames that have '.' (dot) in their username and throwing 404 when try to access their profile page in front end. Can we replace this '.' (dot) with '-' (dash) because working url is with a '.'(dash). The system only generates link with user name ex: domain.com/members/[username automatically added] but some username includes '.' (dot) which system dont recognize. Ex: domain.com/members/user.name -> 404 domain.com/members/user-name -> working
I need to know what the wp specifications for the usernames are. Like allowed minimum and maximum length, are special characters like ü,ö,ä,ß accepted,..? Unfortunately I couldn't find any insight on this in the interweb. Do you have any?
I am using Wordpress 4.9.4 in a Wordpress Multisite, and I need to allow users to register using their email address as username. Looking at the code I found that what prevents me from accomplish that is that in the ms-functions.php there is a regular expression filtering usernames that have other characters than a-z, so when an email is the username I would get "Usernames can only contain lowercase letters (a-z) and numbers." I changed that regular expression in the …
The following plugin was just presented at the special session on data provenance to amend NSA's hard problems during the Hot Topics on Science of Security (HoTSoS) symposium. I'm looking for peer review regarding best practices prior to submission to the WordPress repository. It's fairly self-explanatory and a surprisingly simple way to achieve cross domain interoperability through the hashing of usernames. Other open source networks persist around this concept but Wordpress is a much larger medium with a potential for …
I have a blog (www.ahsrocketlaunch.org) and need to update to the latest version of wordpress. However, I cannot remember the username I used to set up the wordpress account. therefore, I can't access the account to update WordPress. Is there any way to do this?
How do I change a username? My username is showing up in search engines as an author but it's a product and services based site (using only pages) for a client. If I can't remove the author pages I need to change my username. It looks like you can change your username if you are on wordpress.com so that means it might be possible but this is a personal WP install.
I used the snippet below to lock out all administrators and editors except myself if ( is_user_logged_in() ){ $current_user = wp_get_current_user() ; if ( in_array( 'administrator', (array) $current_user->roles ) || in_array( 'editor', (array) $current_user->roles )) { if ($current_user->user_login != 'sheila' ){ wp_logout(); return new WP_Error( 'login_again_please', 'Please log in again' ); } } } When I try to add a second user in the second if statement we are both locked out: if ( is_user_logged_in() ){ $current_user = wp_get_current_user() ; …
when i created my worpress website i have given admin log in user name & password.But i forgot both.Now,how to find my wordpress admin log in username & password? from file or database .What is the procedure?
I would like to display a nickname instead of username/display name on top of my website. I want to insert PHP codes which can display that Nickname in a PHP page. I have tried these codes below, but they don't work: ........some codes above................... <?php global $current_user; wp_get_current_user(); ?> {if is_user_logged_in()} <?php $nickname = $current_user->user_nickName; ?> <?php echo $nickname; ?> ..........some codes below......... But it works for username as below: ........some codes above................... <?php global $current_user; wp_get_current_user(); ?> {if is_user_logged_in()} …
i need help. My users register to the website. They type their username user_login (see chello) but the Display name (see chello04) is not the same. It has a random two digits at the end. Is there a way to force Display names to be the same as usernames?
I'm creating a code that shows the First Name for logged in users, using a shortcode, but I noticed that if the user has no name settle, it will display a blank space. How can I set a custom name to show up instead of the blank space? Something like this "Hi >No Name<, please settle your name in your account." Display first name: // show first name if logged in function colaborador_nome($atts) { if (is_user_logged_in() && !is_feed()) { return …
I'm trying to create shortcodes that will display both avatar and logged in user first name in a text widget. I have managed to create something that displays the avatar, but not the username. My code is as follows: <?php // show user avatar if logged in function colaborator_avatar($atts) { if (is_user_logged_in() && !is_feed()) { return get_avatar(get_the_author_meta( 'user_email' )); } } add_shortcode('colaborator_avatar', 'colaborator_avatar'); // show user avatar if logged in /**/ function colaborator_nome($atts) { if (is_user_logged_in() && !is_feed()) { return …
Is it possible to make WordPress User Name the Company Name instead when user registers on a site. So the Company Name Field on the form is used as the key field upon registration? (Not first name, last name or email address).