Support

Account

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',
        ),
      ),
    )