Created
February 6, 2015 02:47
-
-
Save mauriciogofas/8ab8dec28e07b270485d to your computer and use it in GitHub Desktop.
Replace user profile fields wp (não testado)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//fonte: https://wordpress.org/support/topic/incompatibility-with-custom-profile-fields | |
// Replace user profile fields | |
function add_twitter_contactmethod( $contactmethods ) { | |
// Add Twitter | |
if ( !isset( $contactmethods['twitter'] ) ) | |
$contactmethods['twitter'] = 'Twitter url'; | |
if ( !isset( $contactmethods['facebook url'] ) ) | |
$contactmethods['facebook'] = 'Facebook url'; | |
if ( !isset( $contactmethods['gplus'] ) ) | |
$contactmethods['gplus'] = 'GPlus url'; | |
// Remove Yahoo IM | |
if ( isset( $contactmethods['yim'] ) ) | |
unset( $contactmethods['yim'] ); | |
// Remove AIM | |
if ( isset( $contactmethods['aim'] ) ) | |
unset( $contactmethods['aim'] ); | |
// Remove Jabber/ Google Talk | |
if ( isset( $contactmethods['jabber'] ) ) | |
unset( $contactmethods['jabber'] ); | |
return $contactmethods; | |
} | |
add_filter( 'user_contactmethods', 'add_twitter_contactmethod', __('add_facebook_contactmethod', __('add_gplus_contactmethod', 10, 1 ))); | |
//end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment