Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress: edit user fields
// Add customer user fields in wp admin
function modify_contactmethods( $contactmethods ) {
// Remove unwanted fields //
unset($contactmethods['aim']);
unset($contactmethods['yim']);
unset($contactmethods['jabber']);
// Add new fields //
$contactmethods['twitter_handle'] = 'Twitter Handle (@)';
$contactmethods['linkedin_url'] = 'LinkedIn Profile (URL)';
return $contactmethods;
}
add_filter('user_contactmethods','modify_contactmethods');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment