Home › Forums › ACF PRO › Adding locations to a field group › Reply To: Adding locations to a field group
The location rules are a nested set of arrays, this is your example with some comments
'location' => array (
// each array added at this lever has a relation of 'OR'
// in this case the location rules are
// post_type == portfolio OR post_type == team
array (
// each array at this nesting level has a relation of 'AND'
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'portfolio',
),
// if this rule had an 'AND' it would appear here
),
// OR
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'team',
),
),
)
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.