Home › Forums › Add-ons › Options Page › Uncaught ReferenceError: acf is not defined › Reply To: Uncaught ReferenceError: acf is not defined
I have the same problem with a website that I inherited. The issue is theme-specific and I cannot get in touch with the previous developer. I narrowed it down to this defer parsing of js filter:
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return "$url' defer ";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
When I remove the filter the ACF issue goes away. What is this “defer parsing” anyway and how does it have any impact on the website if it’s removed? I don’t see any issues in the admin or front-end when it’s removed. I tried wrapping it with if( ! is_admin() ) { but that didn’t work and broke most of the menus and links in the admin.
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.