Automattic\WooCommerce\Blocks\Templates
ProductCatalogTemplate::remove_block_template_support_for_shop_page
Remove the template panel from the Sidebar of the Shop page because the Site Editor handles it.
Метод класса: ProductCatalogTemplate{}
Хуков нет.
Возвращает
true|false.
Использование
$ProductCatalogTemplate = new ProductCatalogTemplate(); $ProductCatalogTemplate->remove_block_template_support_for_shop_page( $is_support );
- $is_support(true|false) (обязательный)
- Whether the active theme supports block templates.
Заметки
Код ProductCatalogTemplate::remove_block_template_support_for_shop_page() ProductCatalogTemplate::remove block template support for shop page WC 10.5.0
public function remove_block_template_support_for_shop_page( $is_support ) {
global $pagenow, $post;
if (
is_admin() &&
'post.php' === $pagenow &&
function_exists( 'wc_get_page_id' ) &&
is_a( $post, 'WP_Post' ) &&
wc_get_page_id( 'shop' ) === $post->ID
) {
return false;
}
return $is_support;
}