Hi! I’m trying to make a plugin that uses ACF’s get_field() function to retrieve some data.
I don’t really get it because this piece of code works perfectly fine when it’s placed in a theme file:
add_action( 'acf/init', function() {
get_field('entrees', 'options');
});
However, when I add it to my newly created plugin in the exact same way, it triggers the “acf_get_value was called incorrectly” notice, as if it wasn’t run in the acf/init action.
From what I understand it seems possible to use ACF’s functions in other plugins, so it doesn’t really make sense to me. Some help would be appreciated! Thank you 🙂
Maybe more code would help. I don’t see any reason why the code you supplied would cause this issue. Or possible it is not this code that is causing the issue.