Skip to content

Instantly share code, notes, and snippets.

@ahmad24
Created December 7, 2013 09:15
Show Gist options
  • Save ahmad24/7838906 to your computer and use it in GitHub Desktop.
Save ahmad24/7838906 to your computer and use it in GitHub Desktop.
wordpress : additional contact for user
<?php
/*
Plugin Name: User Contact Methods
Plugin URI: http://example.com
Description: Additional user contact methods.
Author: WROX
Author URI: http://goo.com
*/
/* Add a filter to the hook. */
add_filter( 'user_contactmethods', 'boj_user_contactmethods' );
/* Function for adding new contact methods. */
function boj_user_contactmethods( $user_contactmethods ) {
/* Add the Twitter contact method. */
$user_contactmethods['twitter'] = 'Twitter Username';
/* Add the phone number contact method. */
$user_contactmethods['phone'] = 'Phone Number';
/* Return the array with the new values added. */
return $user_contactmethods;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment