How do I enqueue my assets for a block when using ACF Composer?

How do I enqueue my assets for a block when using ACF Composer?

public function enqueue()
{
  //
}

Use wp_enqueue_script() and wp_enqueue_style() inside of enqueue.

Thanks :slight_smile:

Perhaps I should start a new topic for this, but I’m also wondering if there’s a way to easily add a unique id to a block.

https://www.advancedcustomfields.com/blog/building-a-custom-slider-block-in-30-minutes-with-acf/

I thought maybe using something like $block[‘id’] or $block[‘anchor’] as shown on the page above.

This topic was automatically closed after 42 days. New replies are no longer allowed.