Skip to content

Instantly share code, notes, and snippets.

@chuckreynolds
Created February 28, 2013 09:39
Show Gist options
  • Save chuckreynolds/5055527 to your computer and use it in GitHub Desktop.
Save chuckreynolds/5055527 to your computer and use it in GitHub Desktop.
Custom WordPress User Profile Fields. Who EVER fills out the yim/aim/jabber fields in their wordpress profile? not me and not clients lol... in this, it removes those three fields and adds twitter, facebook and google+ profile url fields. How to add those those new fields to the front end is included in comments
// Add custom fields to user profiles
function vuurr_sm_contactmethods( $contactmethods ) {
// Add
$contactmethods['twitter'] = 'Twitter';
$contactmethods['facebook'] = 'Facebook';
$contactmethods['googleplus'] = 'Google+ About';
// Remove
unset($contactmethods['yim']);
unset($contactmethods['aim']);
unset($contactmethods['jabber']);
return $contactmethods;
}
add_filter('user_contactmethods','vuurr_sm_contactmethods',10,1);
/* add on front-end as <?php the_author_meta('twitter'); ?> */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment