Make WordPress Core

Changeset 29569


Ignore:
Timestamp:
08/21/2014 07:10:59 PM (12 years ago)
Author:
nacin
Message:

Introduce plugin icons in the installer.

See ​http://wp.me/p2AvED-2P8 for the announcement and how to implement these.

props tellyworth.
see #28785.

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

Legend:

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

    r29343 r29569  
    12981298
    12991299.plugin-card h4 {
    1300         float: left;
    13011300        margin: 0 0 12px;
    13021301        font-size: 18px;
    13031302}
    13041303
    1305 .plugin-card .desc {
    1306         clear: left;
    1307 }
    1308 
    13091304.plugin-action-buttons {
     1305        clear: right;
    13101306        float: right;
    13111307        margin-left: 2em;
    … …  
    13491345        float: right;
    13501346        clear: right;
     1347}
     1348
     1349.plugin-icon {
     1350        width: 128px;
     1351        height: 128px;
     1352        float: left;
     1353        margin: 0 1em 1em 0;
    13511354}
    13521355
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r29498 r29569  
    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 ),
    102102                        // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results.
    103103                        'locale' => get_locale(),
    … …  
    399399                        $action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox" aria-label="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
    400400
     401                        if ( !empty( $plugin['icons']['svg'] ) ) {
     402                                $plugin_icon_url = $plugin['icons']['svg'];
     403                        } elseif ( !empty( $plugin['icons']['2x'] ) ) {
     404                                $plugin_icon_url = $plugin['icons']['2x'];
     405                        } elseif ( !empty( $plugin['icons']['1x'] ) ) {
     406                                $plugin_icon_url = $plugin['icons']['1x'];
     407                        } else {
     408                                $plugin_icon_url = $plugin['icons']['default'];
     409                        }
    401410
    402411                        /**
    … …  
    412421                <div class="plugin-card">
    413422                        <div class="plugin-card-top">
     423                                <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><img src="<?php echo esc_attr( $plugin_icon_url ) ?>" class="plugin-icon" /></a>
     424                                <div class="action-links">
     425                                        <?php
     426                                                if ( $action_links ) {
     427                                                        echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
     428                                                }
     429                                        ?>
     430                                </div>
    414431                                <div class="name column-name">
    415432                                        <h4><a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><?php echo $title; ?></a></h4>
    416                                         <div class="action-links">
    417                                                 <?php
    418                                                         if ( ! empty( $action_links ) ) {
    419                                                                 echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
    420                                                         }
    421                                                 ?>
    422                                         </div>
    423433                                </div>
    424434                                <div class="desc column-description">
Note: See TracChangeset for help on using the changeset viewer.