函数原型
is_theme_paused( string $theme ): bool
函数描述
Determines whether a theme is technically active but was paused while loading.
是否弃用
未弃用
函数参数
-
$theme
string
Required - Path to the theme directory relative to the themes directory.
函数返回值
bool True, if in the list of paused themes. False, not in the list.
函数位置
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'] );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |

