ACF PRO 5.8.0 RC2 is now available for download 🥳🤩❤! This includes all the new awesome features shown in the ACF 5.8 – Introducing ACF Blocks for Gutenberg announcement.
To test ACF PRO 5.8.0-RC2, please login to your store account and click the See all versions link alongside your license. Download, extract and replace ‘advanced-custom-fields-pro’ plugin folder contents.
Think you’ve found a bug? Please post in detail a new support ticket.
New to this release are three simple but exciting settings to use when registering a block; “enqueue_script”, “enqueue_style”and “enqueue_assets”. As you may have guessed, these settings will allow you to enqueue styles and scripts with minimal effort.
The “enqueue_script” and “enqueue_style” settings accept a basic file URL, whereas the “enqueue_assets” setting accepts a callback function for finer control. Here is an example registering block assets in 5.8.0-RC2.
acf_register_block_type(array( ... // Specify block style. 'enqueue_style' => get_template_directory_uri() . 'blocks/testimonial/testimonial.css', // Specify block script. 'enqueue_script' => get_template_directory_uri() . 'blocks/testimonial/testimonial.js', ));
These settings also offer some performance benefits too, as assets will only be enqueued if the block is displayed. That said, a counter argument can always be made for a single minified stylesheet or script that is enqueued site wide. Which ever way you like to work is the best way to work!
Thanks to your amazing support, feedback and bug reporting. I’m happy to announce that ACF version 5.8 will be ready for launch in the next week! If you can, please be sure to test out this new version as soon as possible and let us know about any issues you find – and any positive experiences too!
Please find the full list of changes below: