Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding custom fields in user profile

  • @jeremych

    Participant

    Hi guys

    I was trying to have some more custom user fields in http://www.domain.com/forum/users/user/edit/.

    I could see that I can add more fields using form-user-edit.php – however, they are not getting saved on submit.

    That means, I need to add the new variables in some other file in order to get them saved.

    Can anyone help ?
    Best.

    PS. I have read in some places that something like add_filter(‘get_profile_info_keys’, ‘get_profile_info_keys_personal’); would work. I tried that and this is not working, I mean, nothing is getting saved from the extra custom fields.

    WP: 3.8.1
    BBPress : 2.5.3

Viewing 4 replies - 1 through 4 (of 4 total)
  • @jeremych

    Participant

    The idea that I got from https://bbpress.org/forums/topic/profile-user-specified-fields/#post-2670 is not working. Following is the function that I have added in my theme’s functions.php

    function get_profile_info_keys_personal() {
    	return array(	
    		'first_name' => array(1, __('First name')),
    		'last_name' => array(1, __('Last name')),
    		'nickname' => array(1, __('Nickname')),
    		'display_name' => array(1, __('Display name')),
    		'telephone' => array(0, __('Telephone')), 
    		'city' => array(1, __('City')), 
    		'facebook' => array(0, __('Facebook')), 
    		'linkedin' => array(0, __('Linked In')), 
    		'user_url' => array(0, __('Website')), 
    		'signature' => array(0, __('Signature')),
    		'dob' => array(1, __('Date of Birth')), 
    		'state' => array(1, __('Home State')), 
    		'occupation' => array(1, __('Occupation')), 
    		'organization' => array(0, __('Organization')), 
    		'income' => array(1, __('Monthly Income')), 
    		'education' => array(1, __('Education')), 
    		'degree' => array(1, __('Degree')), 
    		'profession' => array(1, __('Profession')), 
    		'description' => array(0, __('Biographical Info')), 
    		'user_login' => array(1, __('Username')), 				
    		'email' => array(0, __('Email')), 
    		'pass1' => array(0, __('Password')) 
    	);
    }
    add_filter('get_profile_info_keys',	'get_profile_info_keys_personal');

    And the second question goes, what would be the corresponding page for adding new members ?

    Thanks a lot for all your help.
    Best.

    @robin-w

    Moderator

    If you’re reasonable at php, download a plugin I wrote for adding town and county to bbpress, and crack this open.

    bbPress town and county plugin

    It has the code to add two fields (town and county) to profile, which displays under the avatar on topics and replies. But you can alter and use this code to add any fields the users profile so that they can edit and update.

    @jeremych

    Participant

    Thanks Robin, that worked like a charm. 🙂

    Thanks for sharing.

    @robin-w

    Moderator

    Great, glad you’re fixed !

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar