Make WordPress Core


Ignore:
Timestamp:
02/05/2015 04:18:57 AM (11 years ago)
Author:
pento
Message:

Shiny Updates: Add ajax-y updates to the plugin list page, and ajax-y updates and installs to the plugin card page.

This also includes JS architecture that can be expanded to support theme, core and language pack updates.

Props pento, ericlewis, lgladdy, adamsilverstein, DrewAPicture

See #29820

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r31244 r31333  
    403403                        if ( $status['url'] ) {
    404404                            /* translators: 1: Plugin name and version. */
    405                             $action_links[] = '<a class="install-now button" href="' . $status['url'] . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
     405                            $action_links[] = '<a class="install-now button" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
    406406                        }
    407407
     
    410410                        if ( $status['url'] ) {
    411411                            /* translators: 1: Plugin name and version */
    412                             $action_links[] = '<a class="button" href="' . $status['url'] . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '">' . __( 'Update Now' ) . '</a>';
     412                            $action_links[] = '<a class="update-now button" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '">' . __( 'Update Now' ) . '</a>';
    413413                        }
    414414
     
    450450            $last_updated_timestamp = strtotime( $plugin['last_updated'] );
    451451        ?>
    452         <div class="plugin-card">
     452        <div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
    453453            <div class="plugin-card-top">
    454454                <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox plugin-icon"><img src="<?php echo esc_attr( $plugin_icon_url ) ?>" /></a>
Note: See TracChangeset for help on using the changeset viewer.