Automattic\WooCommerce\Blocks\Templates
ProductAttributeTemplate::render_block_template
Run template-specific logic when the query matches this template.
Метод класса: ProductAttributeTemplate{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ProductAttributeTemplate = new ProductAttributeTemplate(); $ProductAttributeTemplate->render_block_template();
Код ProductAttributeTemplate::render_block_template() ProductAttributeTemplate::render block template WC 10.5.2
public function render_block_template() {
$queried_object = get_queried_object();
if ( is_null( $queried_object ) ) {
return;
}
if ( isset( $queried_object->taxonomy ) && taxonomy_is_product_attribute( $queried_object->taxonomy ) ) {
$compatibility_layer = new ArchiveProductTemplatesCompatibility();
$compatibility_layer->init();
$templates = get_block_templates( array( 'slug__in' => array( self::SLUG ) ) );
if ( isset( $templates[0] ) && BlockTemplateUtils::template_has_legacy_template_block( $templates[0] ) ) {
add_filter( 'woocommerce_disable_compatibility_layer', '__return_true' );
}
}
}