bp_profile_repeaters_print_group_html_start()

Open wrapper of repeater set – on edit profile screen

Description

Source

File: bp-xprofile/bp-xprofile-repeaters.php

function bp_profile_repeaters_print_group_html_start () {
    $group_id = bp_get_current_profile_group_id();
    $is_repeater_enabled = 'on' == BP_XProfile_Group::get_group_meta( $group_id, 'is_repeater_enabled' ) ? true : false;
    if ( $is_repeater_enabled ) {
        global $first_xpfield_in_repeater;
        $current_field_id = bp_get_the_profile_field_id();
        $current_set_number = bp_xprofile_get_meta( $current_field_id, 'field', '_clone_number', true );
        $template_field_id = bp_xprofile_get_meta( $current_field_id, 'field', '_cloned_from', true );

        $is_required = xprofile_check_is_required_field( $current_field_id );

        $can_delete = ( '1' === $current_set_number && true === $is_required ) ? false : true;

        
        if ( empty( $first_xpfield_in_repeater ) ) {
            $first_xpfield_in_repeater = $template_field_id;
            //start of first set
            ?>
            <div class="repeater_sets_sortable">
            <div class="repeater_group_outer" data-set_no="<?php echo $current_set_number;?>">
                
                <div class="repeater_tools">
                    <span class="repeater_set_title"></span>
                    <a class="repeater_set_edit bp-tooltip" data-bp-tooltip-pos="up" data-bp-tooltip="<?php _e( 'Edit', 'buddyboss' ); ?>">
                        <i class="dashicons dashicons-edit"></i>
                        <span class="bp-screen-reader-text"><?php _e( 'Edit', 'buddyboss' ); ?></span>
                    </a>
	                <?php
	                if ( true === $can_delete ) { ?>
		                <a class="repeater_set_delete bp-tooltip" data-bp-tooltip-pos="up" data-bp-tooltip="<?php _e( 'Delete','buddyboss' ); ?>">
			                <i class="dashicons dashicons-trash"></i>
		                    <span class="bp-screen-reader-text"><?php _e( 'Delete', 'buddyboss' ); ?></span>
		                </a> <?php
	                } ?>

                </div>
                <div class='repeater_group_inner'>

            <?php 
        } else {
            if ( $first_xpfield_in_repeater == $template_field_id ) {
                //start of a new set
                ?>
                </div>
            </div><!-- .repeater_group_outer -->
            <div class="repeater_group_outer" data-set_no="<?php echo $current_set_number;?>">

                <div class="repeater_tools">
                    <span class="repeater_set_title"></span>
                    <a class="repeater_set_edit bp-tooltip" data-bp-tooltip-pos="up" data-bp-tooltip="<?php _e( 'Edit', 'buddyboss' ); ?>">
                        <i class="dashicons dashicons-edit"></i>
                        <span class="bp-screen-reader-text"><?php _e( 'Edit', 'buddyboss' ); ?></span>
                    </a>
	            <?php
	            if ( true === $can_delete ) { ?>
                    <a class="repeater_set_delete bp-tooltip" data-bp-tooltip-pos="up" data-bp-tooltip="<?php _e( 'Delete', 'buddyboss' ); ?>">
                        <i class="dashicons dashicons-trash"></i>
                        <span class="bp-screen-reader-text"><?php _e( 'Delete', 'buddyboss' ); ?></span>
                    </a> <?php
	            } ?>
                </div>
                <div class='repeater_group_inner'>

                <?php 
            }
        }
    }
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.