Adding a twitter box to the Profile page in WordPress

I haven’t used AIM in years and I haven’t used Yahoo Messager in even longer.  What I do use is twitter.  Therefore, having a box in the WordPress admin for twitter name is better and with some code I wrote for the , super easy.

[php]
add_filter(‘user_contactmethods’, ‘jorbin_user_contactmethods’);

/**
* Removes AIM, YAHOO, and Jabber boxes from profile page and adds Twitter in it’s place
*
*/
function jorbin_user_contactmethods($user_contactmethods){
$new_user_contactmethods[‘twitter’] = __(‘Twitter’);

return $new_user_contactmethods;
}
[/php]

Filtering user_contactmethods is one of the easiest things you can do. All you need to do is return an array where the key is the code based name you want and the value is the public facing name. Easy. As. Pie.

Leave a Reply

Your email address will not be published. Required fields are marked *