Skip to:
Content
Pages
Categories
Search
Top
Bottom

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


jivany
Participant

@jivany

OK. I’m thinking you can do something like this. Find this part of the file in register.php:

<?php /***** Extra Profile Details ******/ ?>

<?php if ( bp_is_active( 'xprofile' ) ) : ?>
<div class="register-section" id="profile-details-section">

<h4><?php _e( 'Profile Details', 'buddypress' ) ?></h4>

<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>

At this point, add in a line like:

if( (bp_the_profile_group != "3") || (bp_the_profile_group != "4") ) :

Then go down to this part of the file:

<?php endwhile; ?>

<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />

<?php endwhile; endif; endif; ?>

</div><!-- #profile-details-section -->

Before the first endwhile line, insert this:

<?php endif; ?>

I *think* that should spit out groups 3 & 4 (assuming you have groups 3 & 4 defined in your profile groups). You might need to add in group “1” also to get the Base. The only part I’m not sure about right now is if the number need to be in double quotes or just bare. So it might be:

if( (bp_the_profile_group != 3) || (bp_the_profile_group != 4) ) :

I think. ;)

Skip to toolbar