In wordpress I have a custom post type called ‘break’. In that post type there are an ACF repeater field ‘kort’ with a sub field ‘spiller’.
I would like the items from the repeater to be used in a Ws-form in WordPress as a dropdown selection on a post template.
I have solved the first part of marking a function that put data (option 1) in a selector.
// Add filter to change form ID 123 prior to rendering
add_filter('wsf_pre_render_2', 'my_pre_render_2');
// My function for filter wsf_pre_render_123
function my_pre_render_2($form) {
// Get select field ID: 321
$field = wsf_form_get_field($form, 21);
// Clear the rows in the select field
wsf_field_rows_clear($field);
// Create a new select row
$row = (object) array(
// Set row default parameter (Sets this row as selected)
'default' => true,
// Add one column to the row data
'data' => array('Option 1')
);
// Add the row to the select field
wsf_field_row_add($field, $row);
// Return the form
return $form;
}
```
But now I need the repeater to spit out an array of the field data for the current post.
And I can't get it working