Ticket #51742: 51742.patch
File 51742.patch, 2.8 KB (added by , 4 years ago) |
---|
-
src/wp-admin/update-core.php
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 ) { … … 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 */ … … 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 } 355 361 $auto_update_settings = array( 356 362 'dev' => $upgrade_dev, 357 363 'minor' => $upgrade_minor, … … 361 367 <form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" name="core-auto-updates" class="form-core-auto-updates"> 362 368 <?php wp_nonce_field( 'core-auto-updates-nonce', 'set_core_auto_updates_settings' ); ?> 363 369 <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 } 370 <?php 371 if ( $auto_update_settings['major'] ) { 372 $wp_version = get_bloginfo( 'version' ); 373 $updates = get_core_updates(); 374 if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) { 375 echo '<p>'.wp_get_auto_update_message().'</p>'; 372 376 } 373 ?>374 </p>377 } 378 ?> 375 379 <p> 376 <input type="checkbox" name="core-auto-updates-major" id="core-auto-updates-major" value="1" <?php checked( $auto_update_settings['major'], 1 ); ?> />380 <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 381 <label for="core-auto-updates-major"> 378 382 <?php _e( 'Automatically keep this site up-to-date with regular feature updates.' ); ?> 383 <?php if ( ! empty( $major_optin_disabled ) ) : ?> 384 <em><?php _e( 'This setting has been disabled using a constant or a filter.' ); ?></em> 385 <?php endif; ?> 379 386 </label> 380 387 </p> 381 388 <?php