Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Possible Duplicate:
How To Add Custom Form Fields To The User Profile Page?

I'm current removing some user fields with the following code in the functions.php file:

function adjust_contact_methods( $contactmethods ) {
  unset($contactmethods['aim']);
  unset($contactmethods['jabber']);
  unset($contactmethods['yim']);
  unset($contactmethods['twitter']);
  return $contactmethods;
}
add_filter('user_contactmethods','adjust_contact_methods',10,1);

I'd like to additionally remove the website and Google+ fields, but I can't find the correct keyword. Any advice?

share|improve this question
add comment

marked as duplicate by Chris_O, kaiser, Rarst Oct 2 '12 at 21:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

The following function is from WordPress 3.4.1 default installation source file 'user.php' starting at line 1481.

/**
 * Set up the default contact methods
 *
 * @access private
 * @since
 *
 * @param object $user User data object (optional)
 * @return array $user_contactmethods Array of contact methods and their labels.
 */
function _wp_get_user_contactmethods( $user = null ) {
    $user_contactmethods = array(
        'aim' => __('AIM'),
        'yim' => __('Yahoo IM'),
        'jabber' => __('Jabber / Google Talk')
    );
    return apply_filters( 'user_contactmethods', $user_contactmethods, $user );
}

Additional fields might have been set vi addfilter hooks.

add_filter('user_contactmethods', 'my_user_contactmethods');  

function my_user_contactmethods($user_contactmethods){  

  $user_contactmethods['twitter'] = 'Twitter Username';  
  $user_contactmethods['facebook'] = 'Facebook Username';  

  return $user_contactmethods;  
}

$user_contactmethods is an array.

Try the following code to output the array in one of your pages.

echo "<pre>";
print_r($user_contactmethods);
echo "</pre>";

You will see an array. figure out the key related to Google Plus and unset it.

unset($contactmethods['YOUR_GOOGLE_PLUS_KEY']);
share|improve this answer
add comment
up vote 0 down vote accepted
unset($contactmethods['googleplus']);

Is what I needed to add to my above code.

share|improve this answer
    
Why not accept this as the answer? –  Brian Fegter Aug 30 '12 at 21:06
    
Because it wouldn't let me yet. Had to wait. –  Mike Cole Aug 30 '12 at 21:12
    
Gotcha. Forget how stringent SE is sometimes. :) –  Brian Fegter Aug 30 '12 at 21:13
    
Remind me in 4 hours. :-) –  Mike Cole Aug 30 '12 at 21:13
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.