Introduce plugin icons in the installer.

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

props tellyworth.
see #28785.

Built from https://develop.svn.wordpress.org/trunk@29569


git-svn-id: http://core.svn.wordpress.org/trunk@29343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-08-21 19:11:17 +00:00
parent 31e599943d
commit 0eed9373e2
5 changed files with 36 additions and 20 deletions

View File

@ -1297,16 +1297,12 @@ div.action-links,
}
.plugin-card h4 {
float: right;
margin: 0 0 12px;
font-size: 18px;
}
.plugin-card .desc {
clear: right;
}
.plugin-action-buttons {
clear: left;
float: left;
margin-right: 2em;
margin-bottom: 1em;
@ -1350,6 +1346,13 @@ div.action-links,
clear: left;
}
.plugin-icon {
width: 128px;
height: 128px;
float: right;
margin: 0 0 1em 1em;
}
/* ms */
/* Background Color for Site Status */
.wp-list-table .site-deleted {

View File

@ -1297,16 +1297,12 @@ div.action-links,
}
.plugin-card h4 {
float: left;
margin: 0 0 12px;
font-size: 18px;
}
.plugin-card .desc {
clear: left;
}
.plugin-action-buttons {
clear: right;
float: right;
margin-left: 2em;
margin-bottom: 1em;
@ -1350,6 +1346,13 @@ div.action-links,
clear: right;
}
.plugin-icon {
width: 128px;
height: 128px;
float: left;
margin: 0 1em 1em 0;
}
/* ms */
/* Background Color for Site Status */
.wp-list-table .site-deleted {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$args = array(
'page' => $paged,
'per_page' => $per_page,
'fields' => array( 'last_updated' => true, 'downloaded' => true ),
'fields' => array( 'last_updated' => true, 'downloaded' => true, 'icons' => true ),
// Send the locale and installed plugin slugs to the API so it can provide context-sensitive results.
'locale' => get_locale(),
'installed_plugins' => $this->get_installed_plugin_slugs(),
@ -398,6 +398,15 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
/* translators: 1: Plugin name and version. */
$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>';
if ( !empty( $plugin['icons']['svg'] ) ) {
$plugin_icon_url = $plugin['icons']['svg'];
} elseif ( !empty( $plugin['icons']['2x'] ) ) {
$plugin_icon_url = $plugin['icons']['2x'];
} elseif ( !empty( $plugin['icons']['1x'] ) ) {
$plugin_icon_url = $plugin['icons']['1x'];
} else {
$plugin_icon_url = $plugin['icons']['default'];
}
/**
* Filter the install action links for a plugin.
@ -411,15 +420,16 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
?>
<div class="plugin-card">
<div class="plugin-card-top">
<a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><img src="<?php echo esc_attr( $plugin_icon_url ) ?>" class="plugin-icon" /></a>
<div class="action-links">
<?php
if ( $action_links ) {
echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
}
?>
</div>
<div class="name column-name">
<h4><a href="<?php echo esc_url( $details_link ); ?>" class="thickbox"><?php echo $title; ?></a></h4>
<div class="action-links">
<?php
if ( ! empty( $action_links ) ) {
echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
}
?>
</div>
</div>
<div class="desc column-description">
<p><?php echo $description; ?></p>