Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args = array(
- 'post_type' => array( 'product_variation',),
- // 'post_status' => array( //(string / array) - use post status. Retrieves posts by Post Status, default value i'publish'.
- // // 'publish', // - a published post or page.
- // // 'pending', // - post is pending review.
- // // 'draft', // - a post in draft status.
- // // 'auto-draft', // - a newly created post, with no content.
- // // 'future', // - a post to publish in the future.
- // // 'private', // - not visible to users who are not logged in.
- // // 'inherit', // - a revision. see get_children.
- // // 'trash' // - post is in trashbin (available with Version 2.9).
- // ),
- 'posts_per_page' => -1,
- );
- $the_query = new WP_Query( $args );
- // The Loop
- global $post;
- if ( $the_query->have_posts() ) :
- var_dump($the_query->posts);
- while ( $the_query->have_posts() ) : $the_query->the_post();
- wp_delete_post($post->ID);
- endwhile;
- endif;
- // Reset Post Data
- wp_reset_postdata();
Add Comment
Please, Sign In to add comment