Home › Forums › Add-ons › Options Page › Uncaught ReferenceError: acf is not defined › Reply To: Uncaught ReferenceError: acf is not defined
hope this answer helps some poor lost souls.
jquery must load before the acf stuff. for us, the problem was having async
set on the script tag in an add_filter
function:
<script type='text/javascript' async src='//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script>
note that this is output by in in <head>
by <?php wp_head(); ?>
we wrapped it with an is_admin()
check thusly:
if(!is_admin()) {
add_filter( 'script_loader_tag', function ( $tag, $handle ) {
return str_replace( ' src', ' async src', $tag );
}, 10, 2 );
}
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.