Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active Aug 29, 2015
Embed
What would you like to do?
<?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