Created
June 9, 2017 19:53
-
-
Save joelstransky/42610a8f4bba13f7ef77e051087e8115 to your computer and use it in GitHub Desktop.
Wordpress: Create relationship between two taxonomy's using ACF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$all_tax_a_terms = get_terms( array( 'taxonomy' => 'taxonomy_a', 'hide_empty' => false) ); | |
foreach ($all_tax_a_terms as $a_term) { | |
$b_terms_set_to_a_term = get_terms( array( | |
'taxonomy' => 'taxonomy_b', | |
'meta_key' => 'acf-key-for-taxonomy-b', | |
'meta_value' => $a_term->slug, | |
'hide_empty' => false ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment