I have created extra field that user can edit on their ‘Your Profile’ page. The extra field also available on WordPress register page. What I want to ask is, how to add the field to User > Add new page ? So, when admin creates a user, admin also input the user’s extra field
Leave a Reply
You must be logged in to post a comment.
With no hooks on that page (User > Add new page) other then
user_new_form_tag
its not possible to add new fields unless you hack the core filewp-admin/user-new.php
.You could try adding that extra field by adding in in JQuery and processing it when the
$_post['action'] == 'adduser'
but that wont be very good practice.This is older question but there is this now.. end of form though (only).
WP Version 4.3.0 – File “./wp-admin/user-new.php” – Line 330
Short example:
This will place a field on end of add user form.
How to save custom user meta data/etc from registration/add user/profile edit/etc is beyond scope of the question and has been answered many times previously. See comments as well.
I was able to do this through a rather fragile hack. It uses the output buffer to insert the new field. Thankfully there’s a nice hook to save the field.
See this answer. There are no hooks, but you can do it with jQuery. Simply add your html markup with jQuery and it will be done.