Solved by sending the field value as a data attribute and accessing it in the JS file.
Thanks for sharing, this is useful info.
Do you know if there is going to be any conflict if the users already have either free or Pro version of ACF active?
This looks more like it:
// check if the repeater field has rows of data.
if ( have_rows( 'referral_code', 'option' ) ) {
// loop through the rows of data.
while ( have_rows( 'referral_code', 'option' ) ) : the_row();
if ( 'acX54s' === get_sub_field( 'referral_value' ) ) {
delete_sub_row( 'referral_value', get_row_index() );
}
endwhile;
} else {
// no rows found.
}
An alternative approach is to install https://wordpress.org/plugins/taxonomy-terms-order/, order the terms how you want via drag and drop and then the terms automatically appear in the new custom order.