Custom query shows custom post types in trash

I have a custom wordpress query like so:

$query = new WP_Query(array(
  'post_status' => 'future || publish', 
  'post_type' => 'kalender', 
  'order' => 'ASC'
));

But the problem is that the items shown on the pages also include the items that are in the trash? I don’t understand why because according to the post_status only published & future posts should be shown?

Read More

The item in the trash is a post in the future though? Maybe that’s why it’s shown but how can I exclude that one?

Related posts

Leave a Reply

1 comment

  1. The syntax in the query above is wrong, it should be:

    $query = new WP_Query(array(
      'post_status' => array( 'publish', 'future' ),
      'post_type' => 'kalender',
      'order' => 'ASC'
    ));
    

    That seems to solve the problem. 🙂