Home › Forums › ACF PRO › ACF6 + register_block_type + assets › Reply To: ACF6 + register_block_type + assets
today i had some capacities to give it a try. because there is a viewScript node, i discovered there is also a viewStyle node. And both are working similar. They both load the assets only if the block i actually used. But viewStyle loads the file as inline-css in the <body>. So this seems finally solved for me.
my old code:
"style": ["file:./assets/tabgroup.css","tabgroup"],
"script": ["file:./assets/tabgroup.js","tabgroup"],
recent working code:
"viewStyle": ["file:./assets/tabgroup.css","tabgroup"],
"viewScript": ["file:./assets/tabgroup.js","tabgroup"],
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.