to add some more context, the option page is added using acf_add_options_page
if I use get_option I can see my option, if I do acf_options_page()->get_page("my-page") I can see the page.
If I add an option page with the UI all works find.
so:
– acf_add_options_page + iFrame (wp-load.php) doesn’t work
– UI + iFrame (wp-load.php) works
acf_add_options_page runs in the add_action('acf/init', 'init_acf')
I haven’t found a solution for this but I found another solution that fit my problem, with this code is possible to pre-populate nested fields with some default value:
add_filter('acf/load_value/key=field_607879a1215fc', 'acf_load_default', 10, 3);
function acf_load_default($value, $post_id, $field)
{
if ($value === false) {
$value = array();
$value[] = array(
'field_6081eeaf5a418' => 'Example Title One',
);
$value[] = array(
'field_6081eeaf5a418' => 'Example Title Two',
'field_6081eeb75a419' => array(
array('field_6081eebf5a41a' => 'Example Title Three'),
array('field_6081eebf5a41a' => 'Example Title Four')
)
);
}
return $value;
}
any suggestion on how to fix this?