_maybe_update_core() WordPress Function

The maybe_update_core() function in WordPress allows a site administrator to automatically update the WordPress core software to the latest version. This function will only update the core software if the current version is out of date and if the administrator has the appropriate file permissions.

_maybe_update_core() #

Determines whether core should be updated.


Source

File: wp-includes/update.php

function _maybe_update_core() {
	// Include an unmodified $wp_version.
	require ABSPATH . WPINC . '/version.php';

	$current = get_site_transient( 'update_core' );

	if ( isset( $current->last_checked, $current->version_checked )
		&& 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked )
		&& $current->version_checked === $wp_version
	) {
		return;
	}

	wp_version_check();
}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.