wordpress循环显示挂起的帖子,即使$ count_posts-> publish;

I have an Easy Digital Downloads archive page the shows published downloads, but also pending downloads although its not suppose to. for some reason, the wp_count_posts() doesn't affect on the loop, and I can see also pending posts in the archive page. I cant figure out why.

 <?php
    $count_posts = wp_count_posts('download');
    $published_posts = $count_posts->publish;
    $key = 0;
    ?>
    <?php if (have_posts()) : ?>
        <div class="all_product">
            <div class="row">
                <?php while (have_posts()) : the_post();
                    if ($key < 12) {
                        ?>

                        <div class="col-lg-3 col-md-4 col-sm-12 single-download-list">
                            <?php get_template_part('content-grid', 'download'); ?>
                        </div>

                        <?php
                    }
                    $key++;
                endwhile; ?>


            </div>
        </div>
    <?php else : ?>
 <?php
    $args= array(
    'post_type' => 'download',
    'post_status' => 'publish'
    )
    $posts = get_posts($args); 
    $key = 0;
    ?>
    <?php if ($posts) : ?>
        <div class="all_product">
            <div class="row">
                <?php foreach($posts as $post)  setup_postdata($post ); 
                    if ($key < 12) {
                        ?>

                        <div class="col-lg-3 col-md-4 col-sm-12 single-download-list">
                            <?php get_template_part('content-grid', 'download'); ?>
                        </div>

                        <?php
                    }
                    $key++;
                endforeach;
                endif;
                ?>


            </div>
        </div>
        <?php
          endif;
         wp_reset_postdata();?>
            ?>

    <?php else : ?>