WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/03/17 00:24:31 (2 weeks ago)
Author:
pento
Message:

Plugins: Add plugin icons to the plugin list tables.

To mirror theme list table behaviour, the plugin icon now appears next to plugins in the plugin list tables. For plugins that don't have an icon, or non-W.org plugins, a fallback dashicon is shown.

Props melchoyce, afercia, paulwilde, pento, obenland.
Fixes #30186.

File:
1 edited

Legend:

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

    r41268 r41695  
    253253        $plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true ); 
    254254 
     255        $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="" />'; 
     258        } 
     259 
    255260        // Get plugin compat for running version of WordPress. 
    256261        if ( isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $cur_wp_version, '>=') ) { 
     
    303308            </td> 
    304309            <td class="plugin-title"><p> 
     310                <?php echo $icon; ?> 
    305311                <strong><?php echo $plugin_data->Name; ?></strong> 
    306312                <?php 
Note: See TracChangeset for help on using the changeset viewer.