Tuesday, May 28, 2024
HomeOnline BusinessNew Customized Block-Constructing Options Launched in Superior Customized Fields 6.3

New Customized Block-Constructing Options Launched in Superior Customized Fields 6.3


During the last couple of years, I’ve attended practically a dozen occasions, massive and small, the place the subject of constructing customized blocks with Superior Customized Fields (ACF) has triggered critical curiosity and pleasure amongst the viewers.

It’s no shock that builders are concurrently excited by the way forward for the WordPress expertise whereas additionally desirous to leverage the event workflows they’ve refined for a few years. The ACF group right here at WP Engine loves this—it represents the most effective of what has introduced us right here, mixed with the potential of the place we are able to go!

With this in thoughts, the ACF group is working laborious on a collection of releases to boost customized block constructing with ACF even additional, beginning with the just-released ACF model 6.3. These new options and capabilities will assist you to lean additional into trendy WordPress whereas leveraging your expertise in PHP. 

Let’s take a look!

Subject validation help for ACF Blocks

Limiting what information will be entered right into a kind discipline is a vital a part of a effectively thought via enhancing expertise in WordPress. 

Validation guidelines facilitate this in kind fields, and though these have been configurable for conventional ACF fields for a while, they haven’t functioned for fields in ACF Blocks. Model 6.3 modifications that! Now you can arrange customized validation guidelines in your block fields.

Let’s take a look at an instance under. I’ve a customized block that I’ve constructed for the hero part of a school web site. For the way in which I would like this block for use I wish to ensure that:

  1. The heading isn’t left clean
  2. The heading doesn’t exceed a sure variety of characters

Within the discipline group settings, it’s straightforward to set the validation guidelines.

Setting validation guidelines on a discipline

Now within the content material enhancing expertise, you possibly can see under that when the principles should not met, I see a visible warning for what must be carried out. Moreover, till the rule is met the editor can not save the publish.

Instance of validation error notification within the block editor

Storing ACF Block discipline values in publish meta

By default, WordPress shops discipline information inside the HTML feedback of a block within the post_content column of the posts desk. This works for a lot of situations, however there are many events the place chances are you’ll wish to retailer and browse information from the post_meta desk. 

Model 6.3 makes this doable with a brand new attribute you possibly can embrace in your block.json file: usePostMeta: true (default false). Now you can enter your structured information via the blocks interface somewhat than deferring to the normal customized fields interface.

block.json file together with new usePostMeta attribute set to true.

New icon picker for customized publish varieties and choices pages

The customized publish varieties and choices pages you possibly can simply spin up with ACF seem within the sidebar of the WordPress admin space. When working with ACF for this, you’ve gotten been capable of set an icon to sit down alongside the textual content label. 

Model 6.3 introduces a easy icon picker that pulls within the open-source dashicon library. You’ll be able to nonetheless choose and set your personal, however once you wish to work with the native icon library of the WordPress admin, this new icon picker hastens the expertise.

New icon picker inside ACF 6.3

For the astute ACF person, you might even see this icon picker and assume, “Why don’t we make this a brand new basic discipline kind?” Properly, we did!

New icon picker discipline kind

Leveraging the great work talked about above, there’s now a brand new discipline kind: the “Icon Picker” discipline. When an editor wants to select a dashicon icon or one from the media library, now you can add an icon picker discipline. 

Most trendy net designs use icons ultimately, and ACF customers not should leverage various discipline options for these. We plan so as to add extendability to this discipline kind in a future launch as a way to simply load different in style icon units. 

Deciding on the icon picker discipline kind in a discipline group

These have been the massive headlines for the discharge, nevertheless it additionally contains a variety of different enhancements, which you’ll be able to examine within the full launch publish from the ACF group

Go to the ACF web site if you need to make use of ACF to push the boundaries of what you possibly can construct with WordPress!

Need to stage up your ACF sport?

We run a number of occasions, neighborhood areas, and content material hubs for many who construct with Superior Customized Fields. If you wish to be taught extra and discover different like-minded WordPressers, take a look at
WP Engine Builders.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments