From 1f4ed43c65f618bae1507ac62880f28a45a12972 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 2 Oct 2018 20:06:37 +0000 Subject: [PATCH] Plugin Installer: Allow 4 columns of search results on wide screens. For screens wider than 2300px, show 4 colums of search results, as 3 columns looked quite stretched out. This change also increases the default number of search results from 30 to 36, so that the columns have an even number of results, regardless of whether there are 2, 3, or 4 of them. Props nielslange. Fixes #43573. git-svn-id: https://develop.svn.wordpress.org/trunk@43669 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/list-tables.css | 25 +++++++++++++++++++ .../class-wp-plugin-install-list-table.php | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index 893326ba38..241f490572 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -1398,6 +1398,31 @@ ul.cat-checklist { } } +@media screen and ( min-width: 2300px ) { + .plugin-card { + width: 25%; + width: calc( 25% - 12px ); + } + + .plugin-card:nth-child(odd) { + clear: none; + margin-left: 8px; + } + + .plugin-card:nth-child(even) { + margin-right: 8px; + } + + .plugin-card:nth-child(4n+1) { + clear: both; + margin-left: 0; + } + + .plugin-card:nth-child(4n) { + margin-right: 0; + } +} + .plugin-card-top { position: relative; padding: 20px 20px 10px; diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php index ad4f2b1062..58488aa16c 100644 --- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -93,7 +93,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $paged = $this->get_pagenum(); - $per_page = 30; + $per_page = 36; // These are the tabs which are shown on the page $tabs = array();