Programmatically populating ACF field values in WordPress

ACF has a handy acf/load_field filter for programmatically filling the choices of field types like 'Select' that have multiple values.

This Pro tutorial provides an example of how to set the values of a Select-type field with the names and labels of all public post types in the site.

Notices how Choices are empty.

Now let's use the acf/load_field filter to automatically populate the choices with public post types minus attachments and Bricks templates.

Result after implementing the tutorial:

Step 1

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to 390+ Bricks code tutorials with BricksLabs Pro