Make WordPress Core

Changeset 25886


Ignore:
Timestamp:
10/23/2013 07:53:56 PM (13 years ago)
Author:
nacin
Message:

About page, updates section: Don't show a message on about.php if the updater is 100% disabled. Don't show it if the user can't update core. Don't show the email if notifications are disabled. New string.

Merges [25883] to the 3.7 branch.
see #25603.

Location:
branches/3.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/src

  • branches/3.7/src/wp-admin/about.php

    r25844 r25886  
    5353                </div>
    5454                <?php
    55                         $can_auto_update = wp_http_supports( 'ssl' );
     55                if ( current_user_can( 'update_core' ) ) {
     56                        $future_minor_update = (object) array(
     57                                'current'       => $wp_version . '.1.next.minor',
     58                                'version'       => $wp_version . '.1.next.minor',
     59                                'php_version'   => $required_php_version,
     60                                'mysql_version' => $required_mysql_version,
     61                        );
     62                        require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     63                        $updater = new WP_Automatic_Updater;
     64                        $can_auto_update = wp_http_supports( 'ssl' ) && $updater->should_update( 'core', $future_minor_update, ABSPATH );
     65
    5666                        if ( $can_auto_update ) {
    57                                 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    58                                 $upgrader = new WP_Automatic_Updater;
    59                                 $future_minor_update = (object) array(
    60                                         'current'       => $wp_version . '.1.next.minor',
    61                                         'version'       => $wp_version . '.1.next.minor',
    62                                         'php_version'   => $required_php_version,
    63                                         'mysql_version' => $required_mysql_version,
    64                                 );
    65                                 $can_auto_update = $upgrader->should_update( 'core', $future_minor_update, ABSPATH );
     67                                echo '<p class="about-auto-update cool">' . __( 'This site <strong>is</strong> able to apply these updates automatically. Cool!' ). '</p>';
     68
     69                        // If the updater is disabled entirely, don't show them anything.
     70                        } elseif ( ! $updater->is_disabled() ) {
     71                                echo '<p class="about-auto-update">';
     72                                // If this is is filtered to false, they won't get emails, so don't claim we will.
     73                                // Assumption: If the user can update core, they can see what the admin email is.
     74
     75                                /** This filter is documented in wp-admin/includes/class-wp-upgrader.php */
     76                                if ( apply_filters( 'send_core_update_notification_email', true, $future_minor_update ) ) {
     77                                        printf( __( 'This site <strong>is not</strong> able to apply these updates automatically. But we&#8217;ll email %s when there is a new security release.' ), esc_html( get_site_option( 'admin_email' ) ) );
     78                                } else {
     79                                        _e( 'This site <strong>is not</strong> able to apply these updates automatically.' );
     80                                }
     81                                echo '</p>';
    6682                        }
    67                         if ( $can_auto_update ) : ?>
    68                                 <p class="about-auto-update cool"><?php _e( 'This site <strong>is</strong> able to apply these updates automatically. Cool!' ); ?></p>
    69                         <?php else : ?>
    70                                 <p class="about-auto-update"><?php printf( __( 'This site <strong>is not</strong> able to apply these updates automatically. But we&#8217;ll email %s when there is a new security release.' ), esc_html( get_site_option( 'admin_email' ) ) ); ?></p>
    71                 <?php endif; ?>
     83                }
     84                ?>
    7285        </div>
    7386</div>
Note: See TracChangeset for help on using the changeset viewer.