WP_Block_Templates_Registry::is_registered()publicWP 6.7.0

Checks if a template is registered.

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

Хуков нет.

Возвращает

true|false. True if the template is registered, false otherwise.

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

$WP_Block_Templates_Registry = new WP_Block_Templates_Registry();
$WP_Block_Templates_Registry->is_registered( $template_name );
$template_name(строка) (обязательный)
Template name.

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

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

Код WP_Block_Templates_Registry::is_registered() WP 6.7.1

public function is_registered( $template_name ) {
	return isset( $this->registered_templates[ $template_name ] );
}