_maybe_update_core()WP 2.8.0

Determines whether core should be updated.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

null. Nothing (null).

Usage

_maybe_update_core();

Notes

  • Global. String. $wp_version The WordPress version string.

Changelog

Since 2.8.0 Introduced.

_maybe_update_core() code WP 6.5.4

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();
}