0

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

I want to change a the names of some of the fields in the edit profile page in the backend. For instance, instead of it saying "Twitter", I want it to display "Enter Twitter ID".

I am aware that I can do this by editing the core WP files, but to avoid redoing the same process, how can I do this through the function.php file? What code can I enter that would make this possible?

3
  • Please search before asking questions. This has been answered multiple times.
    – Chris_O
    Aug 25, 2012 at 4:57
  • Respectfully, I believe that you read my question incorrectly. I was asking for ways to change the existing form fields, not add new ones. Aug 25, 2012 at 12:33
  • And there are answers on the linked questions that show you how to do this.
    – kaiser
    Sep 14, 2012 at 17:14

1 Answer 1

1

What you need to look at is hooking into the user_contactmethods filter.

Perhaps something along these lines:

function test_new_contact(){
  $user_contactmethods = array(
      'aim' => __('AIM'),
      'yim' => __('Yahoo IM'),
      'jabber' => __('Jabber / Google Talk'),
      'twitter' => __( 'Enter Twitter ID' ),
  );
  return $user_contactmethods;
}
add_filter( 'user_contactmethods', 'test_new_contact' );

Note the "core" user contact methods should be included in your filter function, unless of course you want to remove them ... then simply do not include them at all.

0

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