Title: Extra field adding in profile builder
Last modified: August 21, 2016

---

# Extra field adding in profile builder

 *  Resolved [Shwet](https://wordpress.org/support/users/sasha1/)
 * (@sasha1)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/)
 * Hi, I want to add an extra checkbox and extra textbox field in registration form.
   But i am using free version of the plugin.
    So can you please guide me how can
   i set these two fields in my front end registration page?. I want to integrate
   the registration page with the constant contact plugin is this possible? And 
   is there any chances of using Simple Local Avatar with the profile edit page 
   on front end? Your reply will be precious…
 * [http://wordpress.org/extend/plugins/profile-builder/](http://wordpress.org/extend/plugins/profile-builder/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Contributor [barinagabriel](https://wordpress.org/support/users/barinagabriel/)
 * (@barinagabriel)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824739)
 * Hello sasha1,
 * PB has a filter in place, which lets you add extra content, for example on the
   register page. This is extraRegistrationField and using a function, you can return
   a string representing the code for a textarea and checkbox (in your case). All
   you need to do (you can use the same filter) is to handle the saving part ( $
   _POST ).
 * If you need help with this further, let me know!
 * Gabriel
 *  Thread Starter [Shwet](https://wordpress.org/support/users/sasha1/)
 * (@sasha1)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824762)
 * barinagabriel thank you for your precious time for replying.
    I have tried some.
   but failed to get the desired result. So can you suggest me the hook to get this?
   Any help would be appreciated.
 *  Plugin Contributor [barinagabriel](https://wordpress.org/support/users/barinagabriel/)
 * (@barinagabriel)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824764)
 *     ```
       add_filter('extraRegistrationField', 'my_extra_function');
   
       function my_extra_function(){
   
       //if the following condition doesn't work to save data, you can move it outside of the function
       if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser'){
   
          //use this condition to save the sent data; in this case $_POST['extraInput']
       }
   
       $myExtraContent = '<p class="extraInput"><label for="extraInput">Your custom extra input</label><input class="text-input" name="extraInput" type="text" id="extraInput"/></p><!-- .form-extraInput -->';'
   
       return $myExtraContent;
       }
       ```
   
 *  Thread Starter [Shwet](https://wordpress.org/support/users/sasha1/)
 * (@sasha1)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824765)
 * barinagabriel thank you so much….
    super fast reply…
 *  Thread Starter [Shwet](https://wordpress.org/support/users/sasha1/)
 * (@sasha1)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824773)
 * [@barinagabriel](https://wordpress.org/support/users/barinagabriel/)..
    unfortunately
   what you provided did not worked…what i used is..
 *     ```
       add_filter('extraRegistrationField', 'my_extra_function');
   
       function my_extra_function(){
   
       //if the following condition doesn't work to save data, you can move it outside of the function
       if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'adduser'){
   
          //use this condition to save the sent data; in this case $_POST['extraInput']
       }
   
       $myExtraContent = '<p class="extraInput"><label for="extraInput">County</label><input class="text-input" name="extraInput" type="text" id="extraInput"/></p>';
       do_action('register_form');
   
       return $myExtraContent;
       }
       ```
   
 * where i am doing wrong?????
    That did not saved entry in the database…
 *  Plugin Contributor [barinagabriel](https://wordpress.org/support/users/barinagabriel/)
 * (@barinagabriel)
 * [13 years ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824774)
 * [@sasha1](https://wordpress.org/support/users/sasha1/)
 * if the only issue is that it is not saving the inserted data, then move the if
   condition out of the function;
 * one thing you can do, is do a var_dump($_POST); outside of the function, and 
   see if you pressed the register button, does it contain some data? If not, you
   need to find a way to delay it, maybe add it in a function which is hooked on
   the “footer” hook (head might be too soon maybe).
 * Gabriel
 *  [ChickenPower](https://wordpress.org/support/users/chickenpower/)
 * (@chickenpower)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824855)
 * Hello, I am a total amateur in programing, but I would appreciate a checkbox 
   in my Profile Builder.
    Something like the user will check that he is 15 years
   or older and he will register as a subscriber15+ for example… I already created
   new role for users and hidden some content for younger users, but didn’t realize
   they can’t assign to those roles by themselves 🙂
 * Could someone please tell me what to add where or give an advice how to create
   this chechbox function?
    Thanks very much!
 *  Plugin Author [Cristian Antohe](https://wordpress.org/support/users/sareiodata/)
 * (@sareiodata)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824856)
 * Hi,
 * You can either have a look at the code Gabriel posted and use it to create a 
   checkbox, OR you can have a look at Profile Builder Hobbyist that allows you 
   to create extra fields: [http://www.cozmoslabs.com/wordpress-profile-builder/](http://www.cozmoslabs.com/wordpress-profile-builder/)
 *  [ChickenPower](https://wordpress.org/support/users/chickenpower/)
 * (@chickenpower)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824857)
 * OK thanks! Didn’t know about this Hobbyist so I will take a look 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Extra field adding in profile builder’ is closed to new replies.

 * ![](https://ps.w.org/profile-builder/assets/icon-256x256.png?rev=2961144)
 * [User Profile Builder - Beautiful User Registration Forms, User Profiles & User Role Editor](https://wordpress.org/plugins/profile-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/profile-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/profile-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/profile-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/profile-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/profile-builder/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [ChickenPower](https://wordpress.org/support/users/chickenpower/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/extra-field-adding-in-profile-builder/#post-3824857)
 * Status: resolved