i’ve made a theme for WordPress and i have included the plugin and all addon-ons. All work fine since version 4.2.2
I get this error on version ACF 4.3.0:
Fatal error: Class 'acf_field' not found in …/acf-gallery/gallery.php on line 4
After a little search in the new ACF 4.3.0 i found the problem in acf.php:
add_action('plugins_loaded', array($this, 'include_before_theme'), 1);
If i change to this:
add_action('after_setup_theme', array($this, 'include_before_theme'), 1);
All work fine but add ons and options disappears, and the exported php not work
Ok, i found the solution. (but an UGLY solution, @elliot surely will do it better)
// includes $this->include_before_theme(); //add_action('plugins_loaded', array($this, 'include_before_theme'), 1); add_action('after_setup_theme', array($this, 'include_after_theme'), 1);
just disabled plugins_loaded
I don’t think this is the good solution. This hook was introduced in 4.3.0
I was having issues with “the_field” giving fatal errors, not sure if it is related. I ended up using an if statement to prevent the call from happening if the_field was undefined (which is probably a good thing anyway)… not sure if its related…
My solution was to register all my fields on INIT hook 😉 or plugins loaded but with priority to 20 because ACF was placed on 1
I just posted a temp fix on a similar thread:
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2019 Advanced Custom Fields. Subscribe