Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active August 29, 2015 13:57
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 billerickson/9585875 to your computer and use it in GitHub Desktop.
Save billerickson/9585875 to your computer and use it in GitHub Desktop.
<?php
/**
* Update Contact Methods
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/add-remove-contact-methods/
*/
function be_contact_methods( $contactmethods ) {
$remove = array( 'aim', 'yim', 'jabber' );
foreach( $remove as $service ) {
if( isset( $contactmethods[$service] ) ) {
unset( $contactmethods[$service]);
}
}
$add = array(
array(
'service' => 'linkedin',
'label' => 'LinkedIn URL',
),
array(
'service' => 'netvibes',
'label' => 'Netvibes URL',
),
array(
'service' => 'twitter',
'label' => 'Twitter URL'
),
);
foreach( $add as $item ) {
if( !isset( $contactmethods[$item['service']] ) ) {
$contactmethods[$item['service']] = $item['label'];
}
}
return $contactmethods;
}
add_filter( 'user_contactmethods', 'be_contact_methods' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment