Support

Account

Home Forums ACF PRO PHP acf_add_local_field_group location to use taxonomy ID?

Solved

PHP acf_add_local_field_group location to use taxonomy ID?

  • Hi
    I’ve exported some ACF acf_add_local_field_group setups to PHP and have a question regarding the location property.

    Here’s the (cutdown) output, which for post_taxonomy and taxonomy use the slug – which I’m thinking ahead might change if the client decides to – so I was wondering if the taxonomy ID could be used instead?

    
    ...
    'location' => array (
      array (
        array (
          'param' => 'post_type',
          'operator' => '==',
          'value' => 'post',
        ),
      ),
      array (
        array (
          'param' => 'post_taxonomy',
          'operator' => '==',
          'value' => 'pa_size:large',
        ),
      ),
      array (
        array (
          'param' => 'taxonomy',
          'operator' => '==',
          'value' => 'product_cat',
        ),
      ),
    ),
    ...
    

    Cheers
    James

  • Actually I’m being an ass – there are no IDs for the taxonomies I’ve mentioned.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘PHP acf_add_local_field_group location to use taxonomy ID?’ is closed to new replies.