I am trying to query some wordpress posts, they have a custom post status of closed
.
When I run this query, they get returned despite their custom status being set to closed
, even though I've asked for published
:
$now = strtotime(date('d.m.Y H:i:s'));
$args = array(
'post_type' => 'vacancy',
'post_status' => 'published',
'posts_per_page' => 1000,
'orderby' => 'meta_value_num',
'meta_key' => 'wpcf-closing-date',
'meta_query' => array(
array(
'key' => 'wpcf-closing-date',
'value' => $now,
'compare' => '<=',
)
),
);
$vacancies = new WP_Query($args);
I would have expected that only posts with the post_status
of published
would have come back. Anybody any ideas why this is returning closed
posts?