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);
}