diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 083159a22f..e60ee25c6c 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -344,7 +344,7 @@ h3 { } .update-core-php h2 { - margin-top: 2em; + margin-top: 4em; } .update-php h2, diff --git a/src/wp-admin/includes/class-core-upgrader.php b/src/wp-admin/includes/class-core-upgrader.php index 4184bc8ea9..df0bbf141f 100644 --- a/src/wp-admin/includes/class-core-upgrader.php +++ b/src/wp-admin/includes/class-core-upgrader.php @@ -48,14 +48,14 @@ class Core_Upgrader extends WP_Upgrader { * * @param object $current Response object for whether WordPress is current. * @param array $args { - * Optional. Arguments for upgrading WordPress core. Default empty array. + * Optional. Arguments for upgrading WordPress core. Default empty array. * - * @type bool $pre_check_md5 Whether to check the file checksums before - * attempting the upgrade. Default true. - * @type bool $attempt_rollback Whether to attempt to rollback the chances if - * there is a problem. Default false. - * @type bool $do_rollback Whether to perform this "upgrade" as a rollback. - * Default false. + * @type bool $pre_check_md5 Whether to check the file checksums before + * attempting the upgrade. Default true. + * @type bool $attempt_rollback Whether to attempt to rollback the chances if + * there is a problem. Default false. + * @type bool $do_rollback Whether to perform this "upgrade" as a rollback. + * Default false. * } * @return string|false|WP_Error New WordPress version on success, false or WP_Error on failure. */ @@ -279,9 +279,9 @@ class Core_Upgrader extends WP_Upgrader { $current_is_development_version = (bool) strpos( $wp_version, '-' ); // Defaults: - $upgrade_dev = true; - $upgrade_minor = true; - $upgrade_major = false; + $upgrade_dev = get_site_option( 'auto_update_core_dev', true ); + $upgrade_minor = get_site_option( 'auto_update_core_minor', true ); + $upgrade_major = get_site_option( 'auto_update_core_major', false ); // WP_AUTO_UPDATE_CORE = true (all), 'minor', false. if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index fcae12eaa0..a4ef446f10 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -300,6 +300,91 @@ function core_upgrade_preamble() { dismissed_updates(); } +/** + * Display WordPress auto-updates settings. + * + * @since 5.6.0 + */ +function core_auto_updates_settings() { + $upgrade_major_value = ''; + if ( isset( $_POST['core-auto-updates-settings'] ) && wp_verify_nonce( $_POST['set_core_auto_updates_settings'], 'core-auto-updates-nonce' ) ) { + if ( isset( $_POST['core-auto-updates-major'] ) && 1 === (int) $_POST['core-auto-updates-major'] ) { + update_site_option( 'auto_update_core_major', 1 ); + } else { + update_site_option( 'auto_update_core_major', 0 ); + } + echo '
'; + _e( 'WordPress auto-updates settings updated.' ); + echo '