Alert: 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.

_maybe_update_themes() WordPress Function

The maybe_update_themes() function is used to check if there is a new version of a theme available. If there is a new version available, it will update the theme.

_maybe_update_themes() #

Check 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.


Top ↑

Source

File: wp-includes/update.php

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


Top ↑

Changelog

Changelog
VersionDescription
2.7.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.