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/includes/class-wp-plugins-list-table.php

    r41683 r41695  
    752752                    break; 
    753753                case 'name': 
    754                     echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>"; 
    755                     echo $this->row_actions( $actions, true ); 
    756                     echo "</td>"; 
     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 
    757765                    break; 
    758766                case 'description': 
Note: See TracChangeset for help on using the changeset viewer.