WC_Brands::template_already_has_brand_block()privateWC 1.0

Check if the template already contains a product brand block.

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

Хуков нет.

Возвращает

true|false. True if template contains a brand block.

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

// private - только в коде основоного (родительского) класса
$result = $this->template_already_has_brand_block( $template );
$template(WP_Block_Template) (обязательный)
The template object.

Код WC_Brands::template_already_has_brand_block() WC 9.8.2

private function template_already_has_brand_block( $template ) {
	if ( ! $template || empty( $template->content ) ) {
		return false;
	}

	return strpos( $template->content, '<!-- wp:post-terms {"term":"product_brand"' ) !== false;
}