get_posts()
uses WP_Query
, so you are probably providing wrong arguments, it’s worth mentioning that the function has some default arguments.
This should get all posts of the CPT myCPT
:
$args = array(
'posts_per_page' => -1,
'post_type' => 'myCPT',
'post_status' => 'any',
);
$posts_array = get_posts( $args ); ?>