Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I hide certain xprofile custom fields groups in the registration page?


  • Gene53
    Participant

    @gene53

    Hi,

    I’m building a BP/WP single install site for a local organization and the extra profile fields are divided in 4 sections:

    Group 1- Full Name (base group)

    Group 2- General Info (location, age, gender, occupation)

    Group 3 – Personal Info (bio, interests, etc.)

    Group 4 – Contact (messengers ID’s, Twitter, etc.)

    What I’m trying to accomplish is to hide groups 3 and 4 on the registration page not to overwhelm the user with a bunch of fields to fill out during sign-up, those fields can be filled out once the user has activated her/his account via “edit profile”.

    Thanks,

    Gene

Viewing 4 replies - 26 through 29 (of 29 total)

  • jivany
    Participant

    @jivany

    It becomes just string manipulation. Create a new function (my_funky_function) and do something like this:

    function my_funky_function() {
    echo str_replace( "username","", bp_get_the_profile_group_field_ids() );
    }

    Then replace the bp_the_profile_group_field_ids() call in edit.php (in your child theme of course) with my_funky_function().

    I think that will work but it’s not tested. ;)

    Edit:

    Oh, sorry, I’m sort of wrong. This is what I get in my edit.php form in the HTML:

    <input type="hidden" name="field_ids" id="field_ids" value="1,3" />

    Field_id 1 is the Username for me. You just need to filter that out so the str_replace call should be “1,” instead of “username”.


    Gene53
    Participant

    @gene53

    Believe it or not, it didn’t work when I changed Username for 1 but it did when I added ,3 (still don’t know what the 3 is for, LOL).

    Does that mean I don’t really need the funky function and simply change the <input type=”hidden” … > in edit.php or should I just leave things as they are now that it seems to work?

    EDIT: when I added ,3, I couldn’t change the value of the next field and “1” still gives me the error…

    EDIT 2: ROFLOL, it didn’t work because I omitted the , (colon) after the 1. Now everything seems to work.

    Thanks again, I really appreciate your help.

    Gene


    jivany
    Participant

    @jivany

    So it works? Tag the topic as resolved. ;)


    Gene53
    Participant

    @gene53

    Done, thanks again.

    Gene

Viewing 4 replies - 26 through 29 (of 29 total)
  • The topic ‘How can I hide certain xprofile custom fields groups in the registration page?’ is closed to new replies.
Skip to toolbar