Home › Forums › Gutenberg › Enqueueing a script when a block is used › Reply To: Enqueueing a script when a block is used
There isn’t any reason to check, really. When you display the block content just enqueue the script there in the footer. You can event “enqueue” a script multiple times and only the first one will count. As an example, I am currently working on a site where I’m using slick slider. I have set up multiple flexible content layouts that use it. Inside my code that displays the flex layout I enqueue the scripts I need.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.