Support

Account

Home Forums General Issues Register two locations via php doesn\'t work Reply To: Register two locations via php doesn\'t work

  • The nesting on your location array is not right

    
    
        'location' => array(
            // each OR group is an array
            array(
              // each location in the group is an array
              array(
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'post',
              ),
              // if you wanted to add an "AND' rule it would go here
            ),
            // this is another OR group
            array(
              array(
                'param' => 'post_type',
                'operator' => '==',
                'value' => 'aran_agencies',
              ),
            ),
          ),
        );
    

    Also, menu order and position are not part of the location, these cannot be set differently for different locations.

    The best way to figure out how to construct parts of a field group is to create one with the features you want and then export it to code, then use that as an example.