I have a custom post type ‘license’ with custom post statuses ‘active,inactive,cancel,expire’. However when I run a get_posts query to get only posts with active status it returns all the posts irrespective of the status.
$active_licenses = get_posts( array(
'post_type' => 'license',
'post_status' => 'active',
'posts_per_page' => -1,
'orderby' => 'ID',
'order' => 'DESC',
) );
I am unable to figure out what am I doing wrong.