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.