How to remove a dropdown list with items from a metabox

Mikado info section dropdown list hidden

I have been searching for hours on google and didn’t come with a result, I am trying to make the mikado info section to be shown as the second picture directly, I don’t want a dropdown list, so you enter to the page and you encounter with the dropdown list already opened, is it clear enough?

Here is the piece of code

if(!function_exists('mkdf_tours_info_section_map')) {

function mkdf_tours_info_section_map() {
    $destinations = mkdf_tours_get_destinations(true);

    $info_section_meta_box = roam_mikado_add_meta_box(
        array(
            'scope' => array('tour-item'),
            'title' => esc_html__('Info Section', 'mkdf-tours'),
            'name'  => 'tours_info_section_meta'
        )
    );


    $info_section_container = roam_mikado_add_admin_container_no_style(array(
        'type'            => 'container',
        'name'            => 'info_section_container',
        'parent'          => $info_section_meta_box,
        'hidden_property' => 'mkdf_tours_show_info_section',
        'hidden_value'    => 'no'
    ));

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_price',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Price', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_discount_price',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Discount Price', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_duration',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Duration', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_destination',
            'type'          => 'select',
            'default_value' => '',
            'label'         => esc_html__('Destination', 'mkdf-tours'),
            'options'       => $destinations,
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_custom_label',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Custom Label', 'mkdf-tours'),
            'description'   => esc_html__('Define custom label which will show on tour lists and tour single pages', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_info_min_years',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Minimum Years Required', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_departure',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Departure/Return Location', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_departure_time',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Departure Time', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_return_time',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Return Time', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );

    roam_mikado_add_meta_box_field(
        array(
            'name'          => 'mkdf_tours_dress_code',
            'type'          => 'text',
            'default_value' => '',
            'label'         => esc_html__('Dress Code', 'mkdf-tours'),
            'parent'        => $info_section_container
        )
    );
}

add_action('roam_mikado_meta_boxes_map', 'mkdf_tours_info_section_map');

}

Read more here:: How to remove a dropdown list with items from a metabox

Leave a Reply

Your email address will not be published. Required fields are marked *