Display a CPT based on a metabox selection

I got it to work by using the following code

function get_gas_options($a) {
$args = array(
    'post_type'         => 'fleet',
    'orderby'           => 'ID',
    'post_status'       => 'publish',
    'order'             => 'ASC',
    'posts_per_page'    => -1 // this will retrive all the post that is published 
);
$result = new WP_Query( $args );
$title_list[''] = "Assign a Vehicle";

if ( $result-> have_posts() ) :
while ( $result->have_posts() ) : $result->the_post();
    $title_list[get_the_ID()] = get_the_title();   
endwhile;
endif; 
wp_reset_postdata();
    
return $title_list;
}