This is because there is no meta key named display_name, so if you want to update a single meta value better use update_user_meta instead of wp_update_user, as update_user_meta() will create the meta field if it doesn’t exist.
like
if ( !empty( $_POST['display_name'] ) ) {
update_user_meta( $current_user->ID, 'display_name', esc_attr( $_POST['display_name'] ) );
}
Then you can use the meta key and value the way you want.
Related Posts:
- Where the Nickname is being used in WordPress
- Building a scalable WordPress favouriting plugin – one serialised meta value array or many meta records
- How to add usermeta to “Notice of Email Change” email message
- How to get user-meta from Social Login registered users?
- delete_user_meta Delete one value out of array
- Upload files programmatically to users
- Displaying a Welcome Message to a Woocommerce User
- update_user_meta add value on the top on existing value
- Set user ID at time of wp_create_user
- I’m trying to update user meta but is always 1, What I doing wrong? [closed]
- Average Account Age
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- Modifying Author Link to add Author Meta in URL
- update_user_meta() misfires sometimes
- Shortcode to update user meta
- Search users with custom meta data
- Add user meta after a user has registered and logged In [closed]
- WordPress /users/me endpoint request forbidden
- Linking form to user meta fields
- Auto populate a user custom field from another user custom field
- Get user edit functions in frontend for site admin
- User updating their profile wipes my custom fields
- How To Export User’s Custom Fields in CSV or XLSX
- Get all user meta_keys and then group users by matching values
- Modifying meta keys in User Meta Pro using user_meta_pre_user_register not working
- How to use get_user_by in plugin
- Confusing problem with displaying message recipient metadata
- Need help getting a certain value out of a multi dimensional array
- How to delete only user meta value (not key) from usermeta table in wordpress?
- How to delete user meta by key
- Getting label name of extra user fields
- Update acf field in woocommerce orders
- Displaying Category Feature image on loop
- WP asking for ftp credentials when deleting plugin
- How to use Virtual Private Server as WordPress Image CDN
- Custom priority with the_content filter based on user input
- Links not opening as they should. Custom WP plugin
- Is website for online game guides doable in WordPress? [closed]
- filter just a portion of plugin function
- Is option_active_plugins actually doing anything useful?
- How to add infinite scroll to element products widget
- How can I resolve an error on WordPress after PHP update
- Cannot edit Sidebar in any theme in wordpress
- how to update wordpress plugin programmatically using plugin path
- YOAST slug does not take the custom permalink I have made
- How to check record is exist or not in WordPress CRUD Operation with $wpdb
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- How can I view the responses of contact forms on different sites in one panel or elsewhere? [duplicate]
- How to add a simple design in classic editor plugin creating post page through another Wp plugin
- How to fix Fatal error: Cannot redeclare get_cli_args() in class-wp-importer.php
- Is there any performance difference between duplicating composer packages among multiple plugins and not doing it? How can I avoid it?
- Deactivated a plugin with a filter, but it still enqueues JS files
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- How to fix template and image buffering issues on website [closed]
- upload_mimes is getting ingored, how to add a new mime type?
- PHP FATAL ERROR
- Remove a specific sitemap from Sitemap_index.xml
- Testing Plugin – Install plugin dependencies in testing enviroment
- How to get all scripts and styles from the header. Including those added by plugins?
- How to add links to different language versions of WordPress
- How to filter plugin search results in wp-admin plugin search page
- How can I disable a plugin in Health Check mode if there’s a critical error?
- Automatically create WooCommerce products page by just uploading the images [closed]
- Multiple plugins settings of same developer into ONE settings page linked together
- additional fields based on the quantity of products selected
- Conflicting plugins break site
- Implementing onSplit/onMerge in dynamic Gutenberg Custom Blocks
- How to disable pagination in WordPress’ API results?
- Best approach to change mobile background image and adding its class
- Including Google Map within a wordpress plugin
- WordPress broken dashboard with ninja-shell text
- wp-login 404 page not redirecting to homepage [closed]
- WordPress Paypal Error “Authentication with PayPal failed: Could not create token.”
- Why is my Gutenberg block not saving and rendering the chessboard?
- Is it possible to use Classes between WordPress plugins with separate namespaces?
- Function to consider a plugin activated for selected users only
- unlimited chat rooms/channels/groups
- WooCommerce Attribute Mapping
- Create index for own custom data in elasticpress from wordpress plugin
- Dropdown menu only appearing when logged in
- Hide attributes based on previous selection
- search by meta field in the regular WordPress admin panel search
- Show different page depending on user role
- Email notification when registred user clicks a link/visits page
- How to get wp_editor field content when it is inside a Form?
- all plug-ins load scripts on all pages
- Fields are not displayed on front end under custom php code in Advanced Custom Fields and Flexible Content field WordPress
- Automatically download dependent plugins from WordPress.org?
- Automatically install bundled plugins during theme activation?
- Webpack configuration for multiblock plugins behaves unexpectedly
- Get list of outdated plugins in the rest api?
- How do I know if an archive correspond to a custom post type taxonomy?
- How to change the version of block.js and plugin to the same of Package.json?
- Warning “Attempt to read property ‘feeds’ on null” using post update function
- How to Remove Default Category Metabox in Custom Post Types
- How to show custom post type in all post section?
- Convert WordPress into Event and membership managment software [closed]
- refresh media library item
- Similar hook to ‘init’ for when plugin page loads
- Elementor wp_register_script showing file when i not use ‘wp_enqueue_script’