Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function test12() {
- $args = array(
- 'post_type' => 'product',
- 'posts_per_page' => '-1',
- );
- $products = get_posts( $args ); ?>
- <?php foreach( $products as $product ) {
- if( has_term( 'composite', 'product_type', $product->ID ) ) {
- $current_product = array(
- 'ID' => $product->ID,
- 'post_status' => 'publish',
- );
- echo 'has';
- print_r($current_product);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement