16 Apr

ACF Chat Fridays: Icon Picker Coming to ACF 6.3

By Mike Davey

ACF Chat Fridays are the biweekly open forum to discuss all things ACF, including future developments, the best ways to build WordPress sites with ACF, and much more.

The April 12th session of ACF Chat Fridays covered the recent releases of ACF 6.2.8 and 6.2.9, and previewed the new icon picking feature coming in ACF 6.3.

Co-hosted by Iain Poulson, Matt Shaw, Liam Gladdy, Anthony Burchell, and Phil Johnston.

Sign up for the next session →

ACF Chat Fridays Banner Image.

Session Recording

You can see the entire session in the player below, or catch the highlights in the session summary.

Session Summary

Iain Poulson got the latest session underway by noting that ACF had made it into the final round of Plugin Madness 2024. We’re pleased to announce that ACF has now taken the title in this year’s bracket-style competition, beating out WooCommerce in the final round. This is the third time ACF has come in first in Plugin Madness, first winning the coveted title in 2016, and again in 2023.

Iain also gave an update on the recent releases of ACF 6.2.8 and ACF 6.2.9. ACF 6.2.8 brings support for WordPress 6.5 features, while ACF 6.2.9 now allows you to override the Select2 escapeMarkup function when initializing a custom Select2. Both releases contain a number of bug fixes.

The highly-anticipated ACF 6.3 is projected to be available for beta testing before the end of the month. Sign up for the ACF beta test email list here. ACF 6.3 includes improvements to ACF Blocks, including field validation support, the ability to save block data in post meta, and a new feature to help headless builders create frontend components.

ACF 6.3 also includes improvements to conditional logic and a new way to choose dashicons. Phil Johnston gave a demo of the new icon picking process during the latest session. You can jump to that part of the video here.

In brief, the new process provides a visual guide to available dashicons, eliminating the need to know the precise string. You can also use an image from the site’s Media Library or an image URL in place of a dashicon. During this demo, Phil noted that the new feature had been built with accessibility in mind, making it easier for users to navigate with the keyboard.

New features and enhancements are always being considered for upcoming releases. You can add your ideas and vote on others on ACF’s Product Feedback board.

Before opening the floor to user questions, Iain also discussed recent upgrades to search on advancedcustomfields.com. Searching ACF documentation is now handled through WP Engine Smart Search. This enhancement significantly improves the search experience, helping you find the information you need more quickly and accurately.

Q&A

We’ve included some of the questions and answers from the latest session below. Minor edits have been made for clarity and style.

Q: Any news about using ACF Blocks with the Interactivity API? I followed the guide for using interactivity with native blocks, and it doesn’t seem to work with ACF Blocks. I think the interactivity library isn’t loaded within the block.

A: You should be able to use the interactivity API with ACF Blocks. You add the supports for interactivity, but there’s also a reference in the block.json file to the view script module. That’s what runs on the front end that makes the block interactive. Everything happening within the block stays the same, it’s just that you have this external reference to another JavaScript file that talks to it.

Nick Diego of Automattic and Damon Cook of WP Engine recently did a session on building custom blocks with the Interactivity API where they go in-depth on this topic.

Follow-up from Liam Gladdy: “I did some more research and exploring with the interactivity API following this session. I said in the session it was a good replacement for the legacy wp-ajax systems, but actually it’s more like a replacement for jQuery, with events and action handlers. Specifically, we had a question asking us to confirm ACF Blocks work correctly with the Interactivity API, so we took the WordPress demo block and turned it into an ACF Block: https://github.com/lgladdy/demo-acf-interactivity-block.

You’ll notice some things you might not have seen before in the demo block. Firstly, the view script is loaded as a module. This is required when using the interactivity API. You’ll also notice the block needs to be built with wp-scripts to handle building the module. We’ll dive deeper into this in upcoming tutorials, but hopefully this quick demo gives you a starting point for using the new APIs with ACF Blocks.”

Q: We have a site with about a thousand posts of a particular post type, and they all have multiple ACF fields on them. We recently needed to add a boolean value field, but obviously, when we go to grab that field, the field has no value on any of the posts until it’s set. We got around this by installing another plugin that allowed us to add fields to a sort of “quick edit,” and then select the values and save them. The plugin would time out from time to time, but we just kept going until they were all set.

I’m wondering if there’s a way to do this natively with ACF. Is there any way to set that value into a default state, rather than having to go into each post and save it?

A: You could likely do this through some of our filters, such as acf/load_value. You’d have to write a function that would essentially check to see if the value is null, and then set it to whatever you want the default to be.

There may be some room for improvement in how the field is set up in the first place. There’s a “Default Value” checkbox when you set it up in the field group editor, but it won’t create a default value if that’s not checked.

You may also be able to do this at the output level. It depends on exactly where you need it. If you’re in your theme code, you basically treat “true” as “true”, and then everything else is false. However, if the value is outputting to the REST API or something like that, then that’s obviously not the answer.

We share relevant resources during the call. We’ll sum them up here and try to provide a bit of context:

Coming Up on ACF Chat Fridays

Register today for the next session of ACF Chat Fridays, taking place April 26th, 2024 at 2pm UTC. Questions and suggestions for the development team are always welcome.

What do you think we should cover as we move further into 2024? Let us know on Twitter.

Register for the next session of ACF Chat Fridays here:

https://wpeng.in/acf-chat-fridays/

The list of upcoming sessions is below.

  • April 26, 2024
  • May 10, 2024
  • May 24, 2024
  • June 7, 2024

Tag or DM us on Twitter to let us know you’ll be there. Suggest new topics, let us know what you’d like to see, and send us feedback with #ACFChatFridays on Twitter.

About the Author