Add Custom User Profile Fields

Place the code below into your functions.php file to add custom user profile fields. Edit or add lines as you see fit.

Remember not to remove the line: return $contactmethods; otherwise this won’t work.

// CUSTOM USER PROFILE FIELDS
function my_custom_userfields( $contactmethods ) {

// ADD CONTACT CUSTOM FIELDS
$contactmethods[‘contact_phone_office’] = ‘Office Phone’;
$contactmethods[‘contact_phone_mobile’] = ‘Mobile Phone’;
$contactmethods[‘contact_office_fax’] = ‘Office Fax’;

// ADD ADDRESS CUSTOM FIELDS
$contactmethods[‘address_line_1’] = ‘Address Line 1’;
$contactmethods[‘address_line_2’] = ‘Address Line 2 (optional)’;
$contactmethods[‘address_city’] = ‘City’;
$contactmethods[‘address_state’] = ‘State’;
$contactmethods[‘address_zipcode’] = ‘Zipcode’;
return $contactmethods;
}
add_filter(‘user_contactmethods’,’my_custom_userfields’,10,1);

About Chetan Satasiya

I am a passionate web developer with experience in PHP, WordPress, BuddyPress, BBPress and Woocommerce and in other web technologies. My main interest is work in all web technologies. I always enjoy exploring new stuff and possibilities, using new technologies and just having fun developing awesome stuff.

Posted on February 28, 2014, in Uncategorized and tagged , . Bookmark the permalink. 1 Comment.

  1. Reblogged this on kunalsoniblog and commented:
    very helpful post

Leave a comment