bp_repeater_set_field_data_pre_validate( mixed $value, BP_XProfile_Field $field )

Prevalidate repeater set data.

Description

bp_xprofile_field_type_is_valid filter doesn’t pass the $field object. So we hook into bp_xprofile_set_field_data_pre_validate filter and save the $field object in a global variable. We then use this global variable later, in bp_xprofile_field_type_is_valid hook.

Parameters

$value

(Required)

$field

(Required)

Return

(mixed)

Source

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

function bp_repeater_set_field_data_pre_validate ( $value, $field ) {
    global $bp_profile_repeater_last_field;
    $bp_profile_repeater_last_field = $field;
    return $value;
}

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.