Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Created May 10, 2013 20:01
Show Gist options
  • Save JiveDig/5556989 to your computer and use it in GitHub Desktop.
Save JiveDig/5556989 to your computer and use it in GitHub Desktop.
Add and remove fields from user profile
// Add and remove fields from user profile
add_filter('user_contactmethods', 'modify_top_contact_methods', 0);
function modify_top_contact_methods($profile_fields) {
// Remove old fields
unset($profile_fields['aim']);
unset($profile_fields['yim']);
unset($profile_fields['jabber']);
// Add new fields
$profile_fields['website_name'] = 'Website/Blog Name';
/* $profile_fields['user_url'] = 'Website/Blog URL'; */
$profile_fields['twitter'] = 'Twitter Username (without @)';
$profile_fields['facebook'] = 'Facebook URL';
$profile_fields['pinterest'] = 'Pinterest URL';
$profile_fields['linkedin'] = 'LinkedIn URL';
$profile_fields['instagram'] = 'Instagram Username';
/* $profile_fields['gplus'] = 'Google+ URL'; */
// To retrieve $twitter = get_the_author_meta('twitter');
return $profile_fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment