You can use the wp_pre_insert_user_data filter.
function wpse_filter_user_data( $data, $update, $id) {
if( isset( $data[ 'user_login' ] ) ) {
$data[ 'display_name' ] = $data[ 'user_login' ];
return $data;
}
$user = get_user_by( 'email', $data[ 'user_email' ] );
$data[ 'display_name' ] = $user->user_login;
return $data;
}
add_filter( 'wp_pre_insert_user_data', 'wpse_filter_user_data', 10, 3 );
You’ll probably want to use Javascript and/or CSS to hide the field too for a better user experience.
$( '.user-display-name-wrap' ).remove();
.user-display-name-wrap {
display:none;
}
Related Posts:
- Upload files programmatically to users
- How to create custom LOGIN and REGISTRATION forms?
- Will WordPress username displayed somewhere in the site?
- Average Account Age
- WordPress Central User Database
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- Custom User meta field display
- How to create multiple users at once?
- Auto populate a user custom field from another user custom field
- Get all user meta_keys and then group users by matching values
- Searchable Semi Random Number Generator on User Profiles
- User / membership Plugin [closed]
- Users Ultra: Hide asterisk for required registration fields?
- User register hook can’t access form request
- Issues with creating user profile for a subscriber, but with different profile page and functionalities
- Is there a way (plugin?) to restrict a user to being able to edit just one page?
- Where the Nickname is being used in WordPress
- Keep one user logged for a year?
- User-Specific Timezones? Hack? Plugin?
- How to turn off email you receive when registered?
- How to get custom field image url of specific size
- Removing WordPress Plugin Menu Item for a specific user
- How WordPress autosave can save plugin fields?
- How can I filter the contents of a metafield before it’s displayed in the admin?
- How to expire all wordpress user passwords instantly?
- How to remove duplicate Custom Fields?
- Make the checkbox meta field checked by default
- Reset WordPress website
- How to transfer all user data between wordpress installations?
- Getting user roles in plugin files
- Saving Custom Post types and fields to a custom table
- Custom Field Template seriously messed up in WP 3.1.1
- How to save additional user data as part of the registration process?
- Implement Autocomplete for a custom field on WordPress Plugin Frontend
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- Create custom registration form for WordPress Multisite
- auto populate list of questions if user select a category xyz
- How to create an input field, and base the output on spreadsheet data? [closed]
- User registration
- How can I copy all users to newly created site on a multisite network in WordPress?
- How do I hide posts across all loops based on the value of a custom field?
- Change label for registration Fields
- Enable users to change change and add taxonomies of posts
- Execute js files doesn’t seem to work
- Users are being redirected to main site when trying to register on subsite of my Multisite network
- Preventing My Plugin From Being Used For Free
- Custom Post Type Fields
- Shortcode to update user meta
- How do I get the user ID of the user that was updated in WordPress?
- how can I query all wordpress users of a blog
- Add Content to Content()
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- get_users(); Is an Undefined Function When Used in Cron Job
- Order posts by meta key ( Using ACF )
- How to add fields in the WordPress editor?
- Custom Login page with custom redirects for each user?
- WordPress function to add text warning on every pages [closed]
- track all external links on blog via username
- Mutliple users editing single document in wordspress
- How to find the Registration page
- Price comparison table based on Custom Post Type?
- wp_logout_url($redirect); is not working in wordpress
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Best practices for user registration with WordPress from an MVC background
- Plugin permissions for Editor role
- Different registration form for different roles
- Structuring function with registration_errors hook
- Role based permission edit for plugins
- Custom Fields for Page Edits
- “After file loaded” action
- How to create repeater field manually, without plugin (ACF Pro)?
- WordPress Phone Field Check (use numbers, spaces and pluses)
- Can export gallery but can’t import it Wp all import
- Create a pdf from the entries in DB
- What database state changes happen after a post is manually “updated” with no changes?
- custom fields not displaying on wordpress site
- WordPress hide post from custom post-type on a single page
- How To Export User’s Custom Fields in CSV or XLSX
- On button click, redirect users to registration page instead of another page
- How can I store user preferences in WordPress and retreive them later?
- Create password protected page, no registration
- How to get post that has non zero or greater than zero meta value
- Creating Nested custom fields
- Add new post using a page inside the website
- Convert usernames listed by the Groups plugin shortcode to displayed names?
- Displaying custom profile fields using Mingle Plugin
- Advanced Custom Fields Plugin – not displaying images
- custom registration form [duplicate]
- I want to remove the register/login WordPress top bar from my website
- Trying to use Advanced Custom Fields with custom image sizes
- A plugin for software reviews site like this one?
- WordPress User Portal
- Need a Plugin to create a registration form for my website? [closed]
- Create Unique and Customized User ID for Website Members in WordPress
- Links not opening as they should. Custom WP plugin
- additional fields based on the quantity of products selected
- WordPress additional update of publications after importing WP All Import Pro
- I am trying to add form using ACF plugin and acf_form() function, but my user fields dont show up properly
- Email notification when registred user clicks a link/visits page
- Fields are not displayed on front end under custom php code in Advanced Custom Fields and Flexible Content field WordPress