_maybe_update_themes()WP 2.7.0

Checks themes versions only after a duration of time.

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

Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

_maybe_update_themes();

Список изменений

С версии 2.7.0 Введена.

Код _maybe_update_themes() WP 6.5.2

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