Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public function test12() {
  2.  
  3. $args = array(
  4. 'post_type' => 'product',
  5. 'posts_per_page' => '-1',
  6. );
  7.  
  8. $products = get_posts( $args ); ?>
  9.  
  10. <?php foreach( $products as $product ) {
  11.  
  12. if( has_term( 'composite', 'product_type', $product->ID ) ) {
  13.  
  14. $current_product = array(
  15. 'ID' => $product->ID,
  16. 'post_status' => 'publish',
  17. );
  18.  
  19. echo 'has';
  20.  
  21. print_r($current_product);
  22.  
  23. }
  24.  
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement