WP_Query not returning custom post type

I'm using the below code to try to return the count of custom post types but the query isn't finding anything. I change the post_type to project and it works fine. This is also being used outside of the loop if that makes a difference?

 function get_user_posts_count($user_id, $post_type) {
    $args['author']     = 1;
    $args['post_type']  = 'project';
    $args['posts_per_page'] = -1;
    $args['post_status']    = 'any, trash';

    $ps = new WP_Query( $args );

    echo var_dump ($ps);

}

Topic wp-query Wordpress

Category Web


WP_Query does not accept a comma delimited string for the post_type argument, it must be one of either a string (for one post_type) or an array (for one-or-more post_type).

$args = array(
    'post_type' => 'post'
);

$query = new WP_Query($args);

OR

$args = array(
    'post_type' => 
    array(
        'post'
    )
);

$query = new WP_Query($args);

OR

$args = array(
    'post_type' => 
    array(
        'post',
        'page',
        'movie',
        'book'
    )
);

$query = new WP_Query($args);

Useful reading:

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.