Plugins: Tweak the plugin icons added in [41695].

- Remove plugins icons from the plugin list table, as there were performance issues loading the icons when the site had lots of plugins.
- Depending on which icons the plugin has uploaded, prefer them in this order: `svg`, `128x128`, `256x256`.
- Improve the style of the fallback icon for plugins that don't have an icon defined.

Props Travel_girl, danieltj, afercia, karmatosed,hugobaeta, empireoflight, brentjett, melchoyce, pento.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41755 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2017-10-04 23:42:55 +00:00
parent 53fd2734bc
commit 5c2609bbdb
3 changed files with 15 additions and 22 deletions
+6 -2
View File
@@ -253,8 +253,12 @@ function list_plugin_updates() {
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
$icon = '<span class="dashicons dashicons-admin-plugins"></span>';
if ( ! empty( $plugin_data->update->icons['default'] ) ) {
$icon = '<img src="' . esc_url( $plugin_data->update->icons['default'] ) . '" alt="" />';
$preferred_icons = array( 'svg', '1x', '2x', 'default' );
foreach ( $preferred_icons as $preferred_icon ) {
if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
$icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />';
break;
}
}
// Get plugin compat for running version of WordPress.