Add Extra Fields to User Profile Page, WordPress user profile extra fields

 In Functions, Wordpress Admin

Add Extra Fields to User Profile Page

Hack: Extra User Details

WordPress is still living in the stone age with its contact forms in the User Profile section (AIM? Yahoo IM?). Fortunately, you can add more current contact methods with this simple code snippet

Add Extra Fields to User Profile Page, WordPress user profile extra fields code snippet, you just need to add the code snippet below to your WordPress theme’s functions.php file.

add_filter('user_contactmethods', 'ns_user_contactmethods');

function ns_user_contactmethods($user_contactmethods){

  $user_contactmethods['twitter'] = 'Twitter Username';
  $user_contactmethods['facebook'] = 'Facebook Username';

  return $user_contactmethods;
}

As you can see, each new contact method just needs a name and a label.

 

Read more about userdata here

Thank you for seeing my tutorial and fell free to share and comment 🙂 . Do you have a code snippet and you want to see it publish on my site ? I will be more than happy to do it please send me a message (here)

Recent Posts

Leave a Comment

Start typing and press Enter to search