WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about allow_major_auto_core_updates

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-admin/update-core.php apply_filters 376 /**
* Display WordPress auto-updates settings.
*
* @since 5.6.0
*/
function core_auto_updates_settings() {
if ( isset( $_GET['core-major-auto-updates-saved'] ) ) {
if ( 'enabled' === $_GET['core-major-auto-updates-saved'] ) {
$notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' );
echo '

' . $notice_text . '

';
} elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) {
$notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' );
echo '

' . $notice_text . '

';
}
}

require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$updater = new WP_Automatic_Updater();

// Defaults:
$upgrade_dev = get_site_option( 'auto_update_core_dev', 'enabled' ) === 'enabled';
$upgrade_minor = get_site_option( 'auto_update_core_minor', 'enabled' ) === 'enabled';
$upgrade_major = get_site_option( 'auto_update_core_major', 'unset' ) === 'enabled';

$can_set_update_option = true;
// WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'development', 'branch-development', 'minor', false.
if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) {
if ( false === WP_AUTO_UPDATE_CORE ) {
// Defaults to turned off, unless a filter allows it.
$upgrade_dev = false;
$upgrade_minor = false;
$upgrade_major = false;
} elseif ( true === WP_AUTO_UPDATE_CORE
|| in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true )
) {
// ALL updates for core.
$upgrade_dev = true;
$upgrade_minor = true;
$upgrade_major = true;
} elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) {
// Only minor updates for core.
$upgrade_dev = false;
$upgrade_minor = true;
$upgrade_major = false;
}

// The UI is overridden by the `WP_AUTO_UPDATE_CORE` constant.
$can_set_update_option = false;
}

if ( $updater->is_disabled() ) {
$upgrade_dev = false;
$upgrade_minor = false;
$upgrade_major = false;

/*
* The UI is overridden by the `AUTOMATIC_UPDATER_DISABLED` constant
* or the `automatic_updater_disabled` filter,
* or by `wp_is_file_mod_allowed( 'automatic_updater' )`.
* See `WP_Automatic_Updater::is_disabled()`.
*/
wp-admin/includes/class-core-upgrader.php apply_filters 380 /**
* Filters whether to enable major automatic core updates.
*
* @since 3.7.0
*
* @param bool $upgrade_major Whether to enable major automatic core updates.
*/

Hook Parameters

Parameter Type Name Description
bool $upgrade_major Whether to enable major automatic core updates.