Home › Forums › General Issues › Location Array not updating after PHP Import › Reply To: Location Array not updating after PHP Import
Hi @lesgrossman
Your location rules are written like this.
Show the field group if:
* post_type == finials
* AND post_type == holdbacks
The issue is that this will never return true. A post can only be of 1 type, not 2 or 3.
To change the AND to OR, your grouping needs to change to this:
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'finials',
'order_no' => 0,
'group_no' => 0,
),
),
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'holdbacks',
'order_no' => 1,
'group_no' => 0,
),
),
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'endcaps',
'order_no' => 2,
'group_no' => 0,
),
),
),
If you had created a new field group and added the rules correctly (into OR groups), this is how the code should have exported
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.