I am running the following code:
$posts = get_posts([ 'post_type' => ['my-type', 'another-type'], 'numberposts' => -1, 'order' => 'ASC', 'orderby' => 'title', 'post_status' => ['published','future'] ]);
It is only returning the status that appears last in the array. So in the above example it returns all posts with status
future. If I swapped the order it would return only the
I set a break point and get the args being passed to WP_Query() and here they are:
Array ( [numberposts] => -1 [category] => 0 [orderby] => title [order] => ASC [include] => Array ( ) [exclude] => Array ( ) [meta_key] => [meta_value] => [post_type] => Array (  => my-type  => another-type ) [suppress_filters] => 1 [post_status] => Array (  => published  => future ) [posts_per_page] => -1 [ignore_sticky_posts] => 1 [no_found_rows] => 1 )
I have seen examples where the status and type is passed as an array. What am I doing wrong?