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.

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;
}

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.

About Aaron Jorbin

Aaron Jorbin is an engineer with Clearspring where he works on AddThis and a WordPress Core Contributor. He has spoken to multiple User Groups and at WordCamps in four time zones. When he's not busy creating and fixing bugs, Aaron helps run an educational simulation conference for over 1500 college students. He'll gladly toast to the GPL any day of the week and happily will discuss whisky, quality beer, or the upper peninsula of Michigan with anyone that wants.
This entry was posted in Code, Programming, WordPress and tagged , , . Bookmark the permalink.

Leave a Reply

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

* * . Now that I have read Adding a twitter box to the Profile page in WordPress, I wanted to say:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">