The ACF data I am trying to reach is on an option page, in php I would have done something like this to access it.
<?php
$repeater_data = get_field('acf_repeater', 'option');
?>
But that does not seem to work in ACF JS. I am searching for a solution. Maby adding the data to the functions file and passing it through in some way.
Yes the enqueue is working fine. So the problem is elsewhere.
Thank you Speakincode, that was a very good answer. I will try to answer better to clear things up a bit. I am trying to get ACF data using JS to post to the DOM (do I need PHP?).
This seems to work much better now, but I still don’t get the right things from ACF, I am trying this:
var acfVersion = acf.get('acf_version');
alert(acfVersion);
Maby it´s wrong.. I get ‘null’.
And this is the functions.php code:
add_action('acf/init', 'my_acf_admin_footer');
function my_acf_admin_footer() {
wp_register_script( 'custom-acf-js', get_template_directory_uri() . '/library/scripts/script-js.js', ['acf-input'], '1.0.0', true);
wp_enqueue_script('custom-acf-js');
}