Does anyone know how I can remove the Twitter and Google Plus profile fields from my functions.php? This is the code that I am using:
function modify_contact_methods($profile_fields) {
unset($profile_fields['twitter']);
unset($profile_fields['googleplus']);
unset($profile_fields['url']);
return $profile_fields;
}
add_filter('user_contactmethods', 'modify_contact_methods');
Usually, unset()
would hide the fields, but all of the fields are still there. I have been able to add additional fields, but not remove any of the preset fields. I am trying to remove some fields and move others (Twitter and Google Plus) to another section just for social media profiles. I know that this isn't conflicting as only Twitter is in this section, not Google Plus and neither of them are hidden. When I've been looking on Google, results show me the unset()
function, or a jQuery hiding function. I want these removed completely.
For your information, I am using Wordpress version 4.0.