diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php
index c08e57f6e9..5366785bfb 100644
a
|
b
|
function core_auto_updates_settings() { |
322 | 322 | $upgrade_minor = get_site_option( 'auto_update_core_minor', true ); |
323 | 323 | $upgrade_major = get_site_option( 'auto_update_core_major', false ); |
324 | 324 | |
| 325 | $major_optin_disabled = ''; |
325 | 326 | // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'minor', false. |
326 | 327 | if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { |
327 | 328 | if ( false === WP_AUTO_UPDATE_CORE ) { |
… |
… |
function core_auto_updates_settings() { |
343 | 344 | $upgrade_minor = true; |
344 | 345 | $upgrade_major = false; |
345 | 346 | } |
| 347 | $major_optin_disabled = ' disabled'; |
346 | 348 | } |
347 | 349 | |
348 | 350 | /** This filter is documented in wp-admin/includes/class-core-upgrader.php */ |
… |
… |
function core_auto_updates_settings() { |
352 | 354 | /** This filter is documented in wp-admin/includes/class-core-upgrader.php */ |
353 | 355 | $upgrade_major = apply_filters( 'allow_major_auto_core_updates', $upgrade_major ); |
354 | 356 | |
| 357 | $is_major_optin_disabled = apply_filters( 'allow_major_auto_core_updates', null ); |
| 358 | if ( isset( $is_major_optin_disabled ) ) { |
| 359 | $major_optin_disabled = 'disabled'; |
| 360 | } |
| 361 | |
355 | 362 | $auto_update_settings = array( |
356 | 363 | 'dev' => $upgrade_dev, |
357 | 364 | 'minor' => $upgrade_minor, |
… |
… |
function core_auto_updates_settings() { |
361 | 368 | <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" name="core-auto-updates" class="form-core-auto-updates"> |
362 | 369 | <?php wp_nonce_field( 'core-auto-updates-nonce', 'set_core_auto_updates_settings' ); ?> |
363 | 370 | <h2><?php _e( 'Auto-update settings' ); ?></h2> |
364 | | <p> |
365 | | <?php |
366 | | if ( $auto_update_settings['major'] ) { |
367 | | $wp_version = get_bloginfo( 'version' ); |
368 | | $updates = get_core_updates(); |
369 | | if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) { |
370 | | echo wp_get_auto_update_message(); |
371 | | } |
| 371 | <?php |
| 372 | if ( $auto_update_settings['major'] ) { |
| 373 | $wp_version = get_bloginfo( 'version' ); |
| 374 | $updates = get_core_updates(); |
| 375 | if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) { |
| 376 | echo '<p>' . wp_get_auto_update_message() . '</p>'; |
372 | 377 | } |
373 | | ?> |
374 | | </p> |
| 378 | } |
| 379 | ?> |
375 | 380 | <p> |
376 | | <input type="checkbox" name="core-auto-updates-major" id="core-auto-updates-major" value="1" <?php checked( $auto_update_settings['major'], 1 ); ?> /> |
| 381 | <input type="checkbox" name="core-auto-updates-major" id="core-auto-updates-major" value="1" <?php checked( $auto_update_settings['major'], 1 ); ?> <?php echo $major_optin_disabled; ?> /> |
377 | 382 | <label for="core-auto-updates-major"> |
378 | 383 | <?php _e( 'Automatically keep this site up-to-date with regular feature updates.' ); ?> |
| 384 | <?php if ( ! empty( $major_optin_disabled ) ) : ?> |
| 385 | <em><?php _e( 'This setting was overridden programmatically.' ); ?></em> |
| 386 | <?php endif; ?> |
379 | 387 | </label> |
380 | 388 | </p> |
381 | 389 | <?php |