Home Forums General Issues Use get_field() in plugin file


Use get_field() in plugin file

  • 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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.