Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter infectedmann

    (@infectedmann)

    Hi!

    I want to add manually the Group selector from the dashboar as a new profile field.

    In the plugin’s folder edit the includes/bp-registration-groups.php file.
    I tested this method today and it’s working.

    Change this:

    <?php $i = 0; $l = 0; ?>
    				<?php if ( bp_has_groups('type='.$bp_registration_groups_display_order.'&per_page='.groups_get_total_group_count() ) ) : while ( bp_groups() && $l < $bp_registration_groups_number_displayed ) : bp_the_group(); ?>
    <?php if ( in_array( bp_get_group_status(), $bp_registration_groups_show_private_groups, true ) ) { ?>
    <li class="reg_groups_item">
    <input class="reg_groups_group_checkbox" type="checkbox" id="field_reg_groups_<?php echo $i; ?>" name="field_reg_groups[]" value="<?php bp_group_id(); ?>" /><label class="reg_groups_group_label" for="field_reg_groups[]"><?php printf( __( '%s', 'buddypress-registration-groups-1' ), bp_get_group_name() ); ?></label>
    
    <?php $l++; ?>
    <?php } ?>
    <?php $i++; ?>
    <?php endwhile; /* endif; */ ?>
    <?php else: ?>
    <p class="reg_groups_none"><?php _e( 'No groups are available at this time.', 'buddypress-registration-groups-1' ); ?></p>
    <?php endif; ?>

    To this:

    <select>
    <?php $i = 0; $l = 0; ?>
    <?php if ( bp_has_groups('type='.$bp_registration_groups_display_order.'&per_page='.groups_get_total_group_count() ) ) : while ( bp_groups() && $l < $bp_registration_groups_number_displayed ) : bp_the_group(); ?>
    <?php if ( in_array( bp_get_group_status(), $bp_registration_groups_show_private_groups, true ) ) { ?>
    <li class="reg_groups_item">
    <option class="reg_groups_group_checkbox" id="field_reg_groups_<?php echo $i; ?>" name="field_reg_groups[]" value="<?php bp_group_id(); ?>"><?php printf( __( '%s', 'buddypress-registration-groups-1' ), bp_get_group_name() ); ?></option>
    </li>
    <?php $l++; ?>
    <?php } ?>
    <?php $i++; ?>
    <?php endwhile; /* endif; */ ?>
    <?php else: ?>
    <p class="reg_groups_none"><?php _e( 'No groups are available at this time.', 'buddypress-registration-groups-1' ); ?></p>
    <?php endif; ?>
    </select>

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