Defered Scripts and ACF Pro Gutenberg Blocks
-
hi everyone
I am having an issue with the Siteground optimizer plugin and deferred scripts.
I am using ACF pro to create a Gutenberg block with enqueue_assets and referencing another script as a dependency.// dependency
wp_enqueue_script( ‘theme-utils’, get_template_directory_uri() . ‘/js/utils.js’, array(), _S_VERSION, true );
// ACF Block
acf_register_block_type( array(
……
‘enqueue_assets’ => function(){
wp_enqueue_script( ‘accordion-script’, get_template_directory_uri() .’/template-parts/blocks/accordion/accordion-block.js’, [‘jquery’, ‘theme-utils’], ‘2.2’, true );
},
}
thing is it’s not respecting the dependency and accordion-script is loaded before theme-utils.If I remove theme-utils from the deferred list (or disable to plugin), it works.
I also cannot see the ACF block script listed on the options to remove it from defered so I think the SG plugin is not registering it at all.
is this a know bug?
- The topic ‘Defered Scripts and ACF Pro Gutenberg Blocks’ is closed to new replies.