Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $wpdb;
- $sql = "
- SELECT p.ID, p.post_parent
- FROM {$wpdb->posts} as p
- INNER JOIN {$wpdb->term_relationships} AS tr ON ( p.post_parent = tr.object_id)
- WHERE tr.term_taxonomy_id IN ( 51, 52 )
- AND p.post_type = 'product_variation' AND p.post_status = 'publish' ORDER BY p.ID ASC
- ";
- $variations = $wpdb->get_results( $sql );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement