get_post_types not working properly in admin

add_action('admin_init', function(){

$post_types = get_post_types( array( 'public' => true ), 'names' );

var_dump($post_types);

});

Leave a Reply

Your email address will not be published.