Make WordPress Core


Ignore:
Timestamp:
04/10/2015 09:07:42 PM (11 years ago)
Author:
azaozz
Message:

Press This: check the bookmarklet version and add the update notice from PHP.
Fixes #31942.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r32102 r32106  
    1515class WP_Press_This {
    1616
     17        // Used to trigger the bookmarklet update notice.
     18        public $version = 8;
     19
    1720        private $images = array();
    1821
     
    3942        public function site_settings() {
    4043                return array(
    41                         /*
    42                          * Used to trigger the bookmarklet update notice. Needs to be set here and in
    43                          * get_shortcut_link() in wp-includes/link-template.php.
    44                          */
    45                         'version' => '8',
    46 
    4744                        /**
    4845                         * Filter whether or not Press This should redirect the user in the parent window upon save.
     
    13241321                <div class="editor-wrapper">
    13251322                        <div class="alerts" role="alert" aria-live="assertive" aria-relevant="all" aria-atomic="true">
    1326                                 <p class="alert is-notice is-hidden should-upgrade-bookmarklet">
    1327                                         <?php printf( __( 'You should upgrade <a href="%s" target="_blank">your bookmarklet</a> to the latest version!' ), admin_url( 'tools.php' ) ); ?>
    1328                                 </p>
     1323                                <?php
     1324
     1325                                if ( empty( $data['v'] ) || $this->version > $data['v'] ) {
     1326                                        ?>
     1327                                        <p class="alert is-notice">
     1328                                                <?php printf( __( 'You should upgrade <a href="%s" target="_blank">your bookmarklet</a> to the latest version!' ), admin_url( 'tools.php' ) ); ?>
     1329                                        </p>
     1330                                        <?php
     1331                                }
     1332
     1333                                ?>
    13291334                        </div>
    13301335
Note: See TracChangeset for help on using the changeset viewer.