Make WordPress Core


Ignore:
Timestamp:
04/07/2015 03:08:38 AM (10 years ago)
Author:
jorbin
Message:

Enable users to initiate a shiny update from plugin detail modal

The plugin detail modal can contain a link to update a plugin. When it does, we should initiate a shiny update.

This relies upon postMessage which isn't available in all browsers, specifically it isn't in IE versions below 8 so this is going to be a progressive enhancement that some small percentage of users will miss out on. These are the same users that can't use the customizer.

Fixes #31739

File:
1 edited

Legend:

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

    r31990 r32062  
    562562            case 'update_available':
    563563                if ( $status['url'] ) {
    564                     echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) .'</a>';
     564                    echo '<a data-slug="' . esc_attr( $api->slug ) . '" id="plugin_update_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) .'</a>';
    565565                }
    566566                break;
Note: See TracChangeset for help on using the changeset viewer.