I'm working on carousel slider plugin. So far so good! But i want the user to be able to select which post type the slider must slide.
Wordpress does have a function called: get_post_types( $args, $output, $operator);
But this function has an argument called '_builtin' (bool). True returns all standard wordpress post_types like 'post, 'page' and 'attachement'. False returns all custom post types.
What I want is to return both.
public function post_type() {
$args = array(
'public' => true,
'_builtin' => true or false // I want this to return both true and false
);
$get_post_types = get_post_types( $args, 'names', $output);
return $get_post_types;
//var_dump($get_post_types);
}
Actual Question
Is there some kind of workaround so i can select both true and false or is it recommended to write my own custom wpdb query? Or is there some kind of method to select true and false?
p.s. i use this function in a class so that explains the "public" keyword
get_post_types([], "names")
?