12 Jul

ACF PRO 5.7.0 – New JavaScript for a Bright Future

Advanced Custom Fields PRO version 5.7.0 is here! This new release contains major improvements to our JavaScript library allowing for advanced conditional logic, faster admin load times, and a solid ground for upcoming exciting features!

At the beginning of this year, we started work on 5.7 with a clear goal in mind to make conditional logic more customize-able. It didn’t take long until we saw the need for a modular JS library that would facilitate inheritance, instances and relationships – Something the previous design did not allow.

This lead us down the exciting road of JavaScript development! We found a better way to handle localization and internationalization, consolidated our existing JS into a powerful library and optimized existing code to speed up load times.

More Conditional Logic Settings 🎉

As mentioned, we have made some major improvements to our conditional logic. In previous versions this setting was restricted to only a handful of fields with basic rules. Now, you can expect to see almost every field available – each with their own rules!

We have added in the basics such as “value is equal to” and have plans to add in many more condition types over the coming releases! What’s even better is that you can create your own conditional logic rules too! Here’s a list of our new conditions.

  • Has any value. Matches when the field has any value (not empty).
  • Has no value. Matches when the field does not have a value (empty).
  • Value is equal to. Matches when the field value is equal to a specific value.
  • Value is not equal to. Matches when the field value is not equal to a specific value.
  • Value matches pattern. Matches when the field value matches a specific regex pattern.
  • Value contains. Matches when the field value contains a specific sub string.
  • Value is greater than. Matches when the number of selected values is greater than a specific amount.
  • Selection is less than. Matches when the number of selected values is less than a specific amount.

Optimizations and Improvements

Less time loading ⚡️

Throughout the development of 5.7, we spent a lot of time in Chrome’s browser performance tool analyzing the scripts that run during a typical page load. For those who are not familiar with this tool, we highly encourage you to check it out, as it has helped us write faster running code!

Even with all the new functionality, you can expect to see faster load times when working with ACF, especially when editing a field group – around 15% faster 🚀.

Less time coding 🐵

Our new JS library boasts a powerful collection of functions and models to speed up development time. This allows developers to define custom field types, field settings and conditional logic rules with just a few lines of code!

If this interests you, be sure to check out our new JavaScript API.

Smarter localization 👩‍💻

Localization and Internationalization play an important role in the WordPress admin area – they allow JS to access translated text and PHP data. We have made major strides towards a more efficient and effective workflow in this area which you can read about in this blog post.

Refined UI 📐

The avid viewer among you may notice minor improvements throughout the admin, but more noticeably when viewing validation errors. We introduced a softer error style to more seamlessly integrate with the WordPress admin.

Looking to the Future

This update is as much about conditional logic as it is about the future of WordPress. There is no doubt we are moving towards a JS dominant future, with the likes of Gutenberg making large strides in this direction. Wherever WordPress takes us, ACF will follow, and provide the best tools to edit content!