_maybe_update_themes()

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Checks themes versions only after a duration of time.

Description

This is for performance reasons to make sure that on the theme version checker is not run on every page load.

Source

function _maybe_update_themes() {
	$current = get_site_transient( 'update_themes' );

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

	wp_update_themes();
}

Changelog

VersionDescription
2.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.