bp_xprofile_ajax_add_repeater_set()

Adds a repeater set.

Description

Source

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

728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
function bp_xprofile_ajax_add_repeater_set () {
    check_ajax_referer( 'bp_xprofile_add_repeater_set', '_wpnonce' );
     
    $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id();
    if ( !$user_id ) {
        die();
    }
     
    $field_group_id = isset( $_REQUEST['group'] ) ? absint( $_REQUEST['group'] ) : false;
    if ( !$field_group_id ) {
        die();
    }
     
    $count = bp_get_profile_field_set_count( $field_group_id, $user_id );
    $count++;
    bp_set_profile_field_set_count( $field_group_id, $user_id, $count );
    die( 'ok' );
}

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.