WooCommerce-like featured gallery

I found a solution to this.

I am using the plugin (No UI) Metabox that has this feature by default.

This is the code i used to achieve my desired result:

add_filter( 'rwmb_meta_boxes', 'prefix_register_meta_boxes' );

function prefix_register_meta_boxes( $meta_boxes )
{
    $prefix = 'rw_';


    $meta_boxes[] = array(
        'title'    => 'Media',
        'pages'    => array( 'bestilling'),
        'fields' => array(
            array(
                'name' => 'URL',
                'id'   => $prefix . 'url',
                'type' => 'file_advanced',
            ),
        )
    );

    return $meta_boxes;
}