Home Forums General Issues How to call acf functions from Objects


How to call acf functions from Objects

  • I’m trying to learn OO WP programming, and have created a CPT factory that creates a Project. Within this Project I want to use acf fields. However, when I call the function exists acf_add_local_fieldgroup, it returns false.

    My plugin uses namespaces (somebody told me that was a smart idea). I cannot find anything about ACF namespaces.

    How do I use acf callbacks in my plugin?

  • You cannot call acf functions until ACF is loaded. If you are trying to call this is the setup of your plugin before acf is loaded. In plugins you need to have these thins set up on the acf/init hook to ensure ACF is loaded.

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

You must be logged in to reply to this topic.