From 7a504df72ae74e5af000ff34bb1a914380845c43 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 21 Aug 2014 19:10:59 +0000 Subject: [PATCH] Introduce plugin icons in the installer. See http://wp.me/p2AvED-2P8 for the announcement and how to implement these. props tellyworth. see #28785. git-svn-id: https://develop.svn.wordpress.org/trunk@29569 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/list-tables.css | 13 ++++++---- .../class-wp-plugin-install-list-table.php | 26 +++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index 871bb5fc12..c95ba200a0 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -1297,16 +1297,12 @@ div.action-links, } .plugin-card h4 { - float: left; margin: 0 0 12px; font-size: 18px; } -.plugin-card .desc { - clear: left; -} - .plugin-action-buttons { + clear: right; float: right; margin-left: 2em; margin-bottom: 1em; @@ -1350,6 +1346,13 @@ div.action-links, clear: right; } +.plugin-icon { + width: 128px; + height: 128px; + float: left; + margin: 0 1em 1em 0; +} + /* ms */ /* Background Color for Site Status */ .wp-list-table .site-deleted { 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 663effeac1..2e1ee5c1ea 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 @@ -98,7 +98,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $args = array( 'page' => $paged, 'per_page' => $per_page, - 'fields' => array( 'last_updated' => true, 'downloaded' => true ), + 'fields' => array( 'last_updated' => true, 'downloaded' => true, 'icons' => true ), // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results. 'locale' => get_locale(), 'installed_plugins' => $this->get_installed_plugin_slugs(), @@ -398,6 +398,15 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { /* translators: 1: Plugin name and version. */ $action_links[] = '' . __( 'More Details' ) . ''; + if ( !empty( $plugin['icons']['svg'] ) ) { + $plugin_icon_url = $plugin['icons']['svg']; + } elseif ( !empty( $plugin['icons']['2x'] ) ) { + $plugin_icon_url = $plugin['icons']['2x']; + } elseif ( !empty( $plugin['icons']['1x'] ) ) { + $plugin_icon_url = $plugin['icons']['1x']; + } else { + $plugin_icon_url = $plugin['icons']['default']; + } /** * Filter the install action links for a plugin. @@ -411,15 +420,16 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { ?>
+ +

-