is_theme_paused() WordPress Function

The is_theme_paused() function allows you to check if a theme is paused. This can be useful for debugging purposes or for checking if a theme is active.

is_theme_paused( string $theme ) #

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


Description

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


Top ↑

Parameters

$theme

(string)(Required)Path to the theme directory relative to the themes directory.


Top ↑

Return

(bool) True, if in the list of paused themes. False, not in the list.


Top ↑

Source

File: wp-admin/includes/theme.php

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'] );
}


Top ↑

Changelog

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