Make WordPress Core

Ticket #28785: 28785-plugin-custom-icons.diff

File 28785-plugin-custom-icons.diff, 2.2 KB (added by tellyworth, 11 years ago)

Variation on the last patch that also supports icon-128x128.png/jpg in assets dir.

  • wp-admin/css/list-tables.css

     
    13031303}
    13041304
    13051305.plugin-card .desc {
    1306         clear: left;
    13071306}
    13081307
    13091308.plugin-action-buttons {
     1309        clear: right;
    13101310        float: right;
    13111311        margin-left: 2em;
    13121312        margin-bottom: 1em;
     
    13501350        clear: right;
    13511351}
    13521352
     1353.plugin-icon {
     1354        width: 128px;
     1355        height: 128px;
     1356        float: left;
     1357        margin: 0 1em 1em 0;
     1358}
     1359
    13531360/* ms */
    13541361/* Background Color for Site Status */
    13551362.wp-list-table .site-deleted {
  • wp-admin/includes/class-wp-plugin-install-list-table.php

     
    9898                $args = array(
    9999                        'page' => $paged,
    100100                        'per_page' => $per_page,
    101                         'fields' => array( 'last_updated' => true, 'downloaded' => true ),
     101                        'fields' => array( 'last_updated' => true, 'downloaded' => true, 'icons' => true, 'banners' => true ),
    102102                        // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results.
    103103                        'locale' => get_locale(),
    104104                        'installed_plugins' => $this->get_installed_plugin_slugs(),
     
    420420                         * @param array $plugin       The plugin currently being listed.
    421421                         */
    422422                        $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
     423                       
     424                        $plugin_icon_url = $plugin['icons']['default'];
     425                        if ( !empty( $plugin['icons']['low'] ) )
     426                                $plugin_icon_url = $plugin['icons']['low'];
    423427                ?>
    424428                <div class="plugin-card">
    425429                        <div class="plugin-card-top">
     430                                <img src="<?php echo esc_attr( $plugin_icon_url ) ?>" class="plugin-icon" />
    426431                                <div class="name column-name"<?php echo $style['name']; ?>>
    427                                         <h4><a href="<?php echo esc_url( $details_link ) ?>" class="thickbox"><?php echo $title; ?></a></h4>
     432                                        <h4><a href="<?php echo esc_url( $details_link ) ?>" class="thickbox"><?php echo $title; ?></a></h4><br />
    428433                                        <div class="action-links">
    429434                                                <?php
    430435                                                        if ( ! empty( $action_links ) ) {