Set “Display name publicly as” to be usernames by default

My WordPress site currently displays users’ identifying information by their FIRSTNAME + LASTNAME. The vast majority prefer to be known by their usernames. I’ve instructed how to change their “Display Name Publicly As” manually (i.e. via their User settings) but this is less than ideal. I would like new users to be shown by their … Read more

WordPress User Name Limitations

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? 1 Answer 1 I think the answer is in the source. $username = wp_strip_all_tags( $username ); … Read more

Hebrew username

I need to add username in hebrew, I have added this, add_filter( ‘sanitize_user’, ‘sanitize_user_with_hebrew’, 10, 3 ); function sanitize_user_with_hebrew( $username, $raw_username, $strict ) { $username = $raw_username; $username = wp_strip_all_tags( $username ); $username = remove_accents( $username ); // Kill octets $username = preg_replace( ‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $username ); $username = preg_replace( ‘/&.+?;/’, ”, $username ); // … Read more

Change user’s display name programmatically

I’d like to change a user’s display name using this code snippet in my theme’s functions.php file: $user_id = 672; $display_name=”Les Yeux”; $user_id = wp_update_user( array( ‘ID’ => $user_id, ‘display_name’ => $display_name ) ); This is adapted from this topic in the codex: https://codex.wordpress.org/Function_Reference/wp_update_user But I can’t get it to work. It didn’t change anything. … Read more