WordPress.org

Ready to get started?Download WordPress

Forums

Auto-Drafts with get_posts ? (1 post)

  1. Alphawolf
    Member
    Posted 11 months ago #

    Hey there,

    I'm using get_posts to generate a list of posts.

    $args = array(
    	'post_type'		=> 'post',
    	'numberposts'		=> -1,
    	'post_status'		=> array('publish'),
    	'orderby'		=> 'post_date',
    	'order'			=> 'DESC',
    	'suppress_filters'	=> false
    );
    
    $posts = get_posts( $args );

    However, the list includes posts named "Auto-Draft", even though I do not include them in the 'post_status' parameter.

    Anything I'm missing? Thanks!

Reply

You must log in to post.

About this Topic