WordPress at Your Fingertips
function is not described

WP_Theme::exists() public WP 3.4.0

Whether the theme exists.

A theme with errors exists. A theme with the error of 'theme_not_found', meaning that the theme's directory was not found, does not exist.

{} It's a method of the class: WP_Theme{}

No Hooks.


true|false. Whether the theme exists.


$WP_Theme = new WP_Theme();


Since 3.4.0 Introduced.

Code of WP_Theme::exists() WP 5.8

public function exists() {
	return ! ( $this->errors() && in_array( 'theme_not_found', $this->errors()->get_error_codes(), true ) );