Collections : list view by default instead of grid

When you browse private files or pages, you will see your items displayed in a view that we call “collections”. By default, your items are displayed on a list view. You can change the default view, however, you should remember that some cookies are used to store the user choice for the next time he will browse the page.

since: 7.1.5

function change_default_collection_views($data)
    $data['default_collection_view'] = array();

    // You can comment below whichever code is not needed

    // Globally change all views to list
    $private_types = cuar()->get_private_post_types();
    foreach ($private_types as $type) {
        $data['default_collection_view'][$type] = 'grid';

    // Only change default view to list for private pages
    $data['default_collection_view']['cuar_private_page'] = 'list';

    return $data;

add_filter('cuar/core/js-messages?zone=frontend', 'change_default_collection_views', 100, 1);