Automattic\WooCommerce\Blocks\Templates

ProductCatalogTemplate::remove_block_template_support_for_shop_page()publicWC 1.0

Remove the template panel from the Sidebar of the Shop page because the Site Editor handles it.

Method of the class: ProductCatalogTemplate{}

No Hooks.

Return

true|false.

Usage

$ProductCatalogTemplate = new ProductCatalogTemplate();
$ProductCatalogTemplate->remove_block_template_support_for_shop_page( $is_support );
$is_support(true|false) (required)
Whether the active theme supports block templates.

Notes

ProductCatalogTemplate::remove_block_template_support_for_shop_page() code WC 9.3.3

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;
}