I feel like I must be (hopefully) missing something obvious here. Started using ACF for a big project a couple of months ago. The end product is used on a multi-site install that currently has a dozen client sites running with more being added steadily.
I have some field groups set to display only on certain post types and post taxonomies. ie: Only show this group if the post type = “product” and the post taxonomy = “sports” (those aren’t the real ones, just examples).
Problem I’m running into is the conditional display PHP code for the post taxonomy bit looks like this:
array(
'param' => 'taxonomy',
'operator' => '==',
'value' => '28' ...
But the taxonomy term won’t have the same ID on each site. If I were including the code via the theme functions.php I could just edit the value on a per site basis, but I’m including it via a custom plugin.
If the PHP export were using the term slug I could keep that consistent across sites but the term id I can’t control.
So, am I missing something obvious or is this a limitation of the way the PHP export currently works?
Thanks.
Hi @wunderdojo
This is a current limitation of ACF and WP.
I’ll add this to the to-do and see if the slug can be used instead of the ID.
Thanks
E
Gotcha, thanks for responding. If I get a free moment before you get a chance to do anything with it I’ll slap together a variation using slug and send you the code. In a dev -> staging -> production environment term ID is likely to get out of sync while term slug you have some degree of control over, espec. if you preface them in a consistent and unique way (ie: dojo-some-term-slug).
Cheers!