Hello,
I’m trying get values from a repeater value and use these values in select field.
Both fields are in custom post type and repeater field’s values changes for every post.
Fields look like this.
https://prnt.sc/wmhpdx
And my function code is like this.
function acf_load_marke_name_field_choices($field)
{
if( have_rows('applicable_products') ) {
// while has rows
while( have_rows('applicable_products') ) {
// instantiate row
the_row();
// vars
$label = get_sub_field('applicable_product_name');
$field['choices'][ $label ] = $label;
}
}
return $field;
}
add_filter('acf/load_field/key=field_5ffc592f83066', 'acf_load_marke_name_field_choices');
How should I change the code, so I can get values from repeater field to select field differently for every custom post.