User profiles in WordPress have these fields for Contact Info by default: E-mail, Website, AIM, Yahoo IM, Jabber / Google Talk. You can remove those and add new ones as you wish, like in this example code for your functions.php file in your theme:
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;
}
To display that publicly, you could:
$user_id = 1;
$key = 'twitter';
$single = true;
$user_twitter = get_user_meta( $user_id, $key, $single);
echo $user_twitter;
Missed a line! Without defining the filter, the function itself won’t do anything!
+1
Really like this, and glad I’ve found it! Definitely going to use it on my WordPress installs.
Awesome. Didn’t know this, thank you.
Removing just works for those three: AIM, YIM, Jabber ;(
unset ($ contactmethods [‘url’]) does not remove