WP_Theme::exists()publicWP 3.4.0

Determines 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.

Метод класса: WP_Theme{}

Хуков нет.

Возвращает

true|false. Whether the theme exists.

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

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

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

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

Код WP_Theme::exists() WP 6.5.2

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