Created
August 29, 2019 14:20
-
-
Save remcotolsma/50af12324d57d882fa628052b0f53964 to your computer and use it in GitHub Desktop.
Providers and slots GEO query WordPress.
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 | |
$providers_query = new WP_Query( | |
array( | |
'post_type' => 'provider', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'country', | |
'field' => 'slug', | |
'terms' => 'nl', | |
), | |
), | |
) | |
); | |
$provider_slugs = wp_list_pluck( $providers_query->posts, 'post_name' ); | |
$slots_query = new WP_Query( | |
array( | |
'post_type' => 'slot', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'game_provider', | |
'field' => 'slug', | |
'terms' => $provider_slugs, | |
), | |
), | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment