• Posted: 2011-07-11
  • Author: Filip Stefansson
  • Tags:

Add/remove contact info fields

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
<?php
function new_contactmethods( $contactmethods ) {
    $contactmethods['twitter'] = 'Twitter'; // Add Twitter
    $contactmethods['facebook'] = 'Facebook'; // Add Facebook
    unset($contactmethods['yim']); // Remove YIM
    unset($contactmethods['aim']); // Remove AIM
    unset($contactmethods['jabber']); // Remove Jabber

    return $contactmethods;
}
add_filter('user_contactmethods','new_contactmethods',10,1);  
?>

Instructions:

The “Contact Info” fields in the edit profile page in WP-Admin is missing some important fields, like Twitter and Facebook. To add or remove fields from this section, just add the following to your functions.php.

Take a look at this snippet to display the users information.


Related links:
http://wp-snippets.com/display-user-info/
Share this snippet

If you like this snippet, share it with friends!