Support

Account

Forum Replies Created

  • thanks to another user on this forum, I realised that I’d caused this issue by loading all scripts including jQuery with the ‘defer’ tag.
    the code, which filters all enqueued scripts now looks like this:

    function add_async_attribute($tag, $handle) {
        if (!is_admin()) return str_replace( ' src', ' defer="defer" src', $tag );
        return $tag;
    }
    add_filter('script_loader_tag', 'add_async_attribute', 10, 2); 

    i.e. it’s turned off for admin pages, so that scripts load before inline ACF code is executed.

Viewing 1 post (of 1 total)