Make WordPress Core

Changeset 41755

Timestamp:
10/04/2017 11:42:55 PM (7 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.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r41695 r41755  
    12891289.wp-list-table.plugins .plugin-title,
    12901290.wp-list-table.plugins .theme-title {
     1291
    12911292    white-space: nowrap;
    1292 }
    1293 
    1294 .wp-list-table.plugins .theme-title {
    1295     padding-right: 12px;
    1296 }
    1297 
    1298 .wp-list-table.plugins .plugin-title {
    1299     padding-right: 86px; /* 64 (icon width) + 10 (icon padding) + 12 (title padding) = 86 */
    13001293}
    13011294
     
    13091302
    13101303.plugins .plugin-title .dashicons:before {
    1311     font-size: 64px;
     1304    padding: 2px;
     1305    background-color: #eee;
     1306    box-shadow: inset 0 0 10px rgba(160,165,170,.15);
     1307    font-size: 60px;
     1308    color: #B4B9BE;
    13121309}
    13131310
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r41695 r41755  
    752752                    break;
    753753                case 'name':
    754                     $icon = '<span class="dashicons dashicons-admin-plugins"></span>';
    755                     if ( ! empty( $plugin_data['icons']['default'] ) ) {
    756                         $icon = '<img src="' . esc_url( $plugin_data['icons']['default'] ) . '" alt="" />';
    757                     }
    758                     ?>
    759                     <td class="plugin-title column-primary">
    760                         <?php echo $icon; ?>
    761                         <strong><?php echo $plugin_name; ?></strong>
    762                         <?php echo $this->row_actions( $actions, true ); ?>
    763                     </td>
    764                     <?php
     754                    echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>";
     755                    echo $this->row_actions( $actions, true );
     756                    echo "</td>";
    765757                    break;
    766758                case 'description':
  • 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.