Customizing Users in Admin Area

How can I add them to the middle?

You won’t be able to add them directly where you want, but you can get close.

There are four hooks to put stuff into the profile page:

  • personal_options — fires on every user edit screen, including when a user is viewing their own profile. Directly above username.
  • profile_personal_options — fires only when a user is viewing/editing their own profile. Directly above username.
  • show_user_profile — fires when the a user is viewing/editing their own profile. At the bottom of the page, before the submit.
  • edit_user_profile — fires when another user is editing a profile (eg. an admin editing someone else’s profile). At the bottom of the page, before the submit.

Most examples put the fields in show_user_profile and edit_user_profile.

add_action('show_user_profile', 'wpse142687_show_fields');
add_action('edit_user_profile', 'wpse142687_show_fields');
function wpse142687_show_fields($user)
{
   // echo fields and such
}

In your case, you probably want to use personal_options:

add_action('personal_options', 'wpse142687_show_fields');
function wpse142687_show_fields($user)
{
   // anything here will be shown directly above the username field
   // please note that it's inside a form table, so you should format
   // your HTML fields accordingly
}

Saving the fields works the same as putting them at the bottom.

add_action('personal_options_update', 'wpse142687_save_fields');
add_action('edit_user_profile_update', 'wpse142687_save_fields');
function wpse142687_save_fields($user_id)
{
   // check nonce
   // check permisions
   // save stuff
}