is_theme_paused()WP 5.2.0

Determines whether a theme is technically active but was paused while loading.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.

Хуков нет.

Возвращает

true|false. True, if in the list of paused themes. False, not in the list.

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

is_theme_paused( $theme );
$theme(строка) (обязательный)
Path to the theme directory relative to the themes directory.

Заметки

  • Global. WP_Paused_Extensions_Storage. $_paused_themes

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

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

Код is_theme_paused() WP 6.5.2

function is_theme_paused( $theme ) {
	if ( ! isset( $GLOBALS['_paused_themes'] ) ) {
		return false;
	}

	if ( get_stylesheet() !== $theme && get_template() !== $theme ) {
		return false;
	}

	return array_key_exists( $theme, $GLOBALS['_paused_themes'] );
}