Closed hik200 closed 3 years ago
Hello,
Thanks for the feedback!
The Block Type UI is just an UI that use acf_register_block_type()
behind the scene. As explained in the ACF documentation:
_enqueue_assets (Callable) (Optional) A callback function that runs whenever your block is displayed (front-end and back-end) and enqueues scripts and/or styles._
So for example, in the Block Type UI you can set Enqueue Assets = my_block_type_assets
, and then add in your functions.php
file:
function my_block_type_assets(){
wp_enqueue_script( 'bgtest2-swiper', get_template_directory_uri() . '/js/swiper/swiper-bundle.js', array(), _S_VERSION, true );
wp_enqueue_script( 'block-swiper-carousle', get_template_directory_uri() . '/js/scripts/swiper-carousel.js', array(), '', true );
}
Hope it helps!
Have a nice day!
Regards.
Describe the bug How to work ACF-Extended block type editor in GUI rather enqueue assets.
To Reproduce Go to ACF menu-> Block Type -> Enqueu->Enqueu assets.
Expected behavior Unknow
Screenshots If applicable, add screenshots to help explain your problem.
WordPress & ACF WordPress version: 5.8.2 ACF Pro version: 5.10.0 ACF add-ons: ACF Extened 0.8.8.6
No see any useful instruction about this field. Or better make some kind "+" button in style and script tab of this section. The issue may resolve by adding some filter in function but I don't understand how to work with GUI option.