Skip to content

Instantly share code, notes, and snippets.

@johndugan
Created July 12, 2012 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndugan/3095471 to your computer and use it in GitHub Desktop.
Save johndugan/3095471 to your computer and use it in GitHub Desktop.
WordPress: admin custom user fields
// ----------------------------------------------------------
// ---------- Add customer user fields in wp admin ----------
// ----------------------------------------------------------
<?php
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