• Resolved piotroxy

    (@piotroxy)


    Hi,
    How can I add products with “Published” post status (or exclude products with “Draft” status) to the file?

    Thanks and regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Thanks for using our plugin and reaching out to us. Our plugin only retrieves products with post status publish. Any other status will not be picked up anyhow.

                    // Construct WP query
                    $wp_query = array(
                                    'posts_per_page' => $offset_step_size,
                                    'offset' => $nr_products_processed,
                                    'post_type' => $post_type,
                                    'post_status' => 'publish',
                                    'fields' => 'ids',
                                    'no_found_rows' => true,
                    );
                    $prods = new WP_Query($wp_query);
    Thread Starter piotroxy

    (@piotroxy)

    Thank you for your prompt reply!
    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post status – include or exclude’ is closed to new replies.