WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2017 11:42:55 PM (2 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/update-core.php

    r41695 r41755  
    254254
    255255        $icon = '<span class="dashicons dashicons-admin-plugins"></span>';
    256         if ( ! empty( $plugin_data->update->icons['default'] ) ) {
    257             $icon = '<img src="' . esc_url( $plugin_data->update->icons['default'] ) . '" alt="" />';
     256        $preferred_icons = array( 'svg', '1x', '2x', 'default' );
     257        foreach ( $preferred_icons as $preferred_icon ) {
     258            if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
     259                $icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />';
     260                break;
     261            }           
    258262        }
    259263
Note: See TracChangeset for help on using the changeset viewer.