Blog

Populating ACF Select Fields with Post Type Values

In order to use Conditional Logic within the Advanced Custom Fields plugin, one needs to either use a True / False or Select field type. As of Version 4.3.7, one cannot use the Post Object field type with Conditional Logic. The way around this constraint is to dynamically populate a select field’s choices with Post Type values. The code below replicates the behavior of the Post Object field type while allowing the Conditional Logic of the Select field type. Use the following code in your functions.php file: