WordPress at a glance
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.

Return

true/false. Whether the theme exists.

Usage

$WP_Theme = new WP_Theme();
$WP_Theme->exists();

Changelog

Since 3.4.0 Introduced.

Code of WP_Theme::exists() WP 5.5.1

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