Automattic\WooCommerce\Blocks

BlockTemplatesController::update_product_archive_title()publicWC 1.0

Update the product archive title to "Shop".

Attention: this method is run in classic themes as well, so it can't be moved to the ProductCatalogTemplate class. See: https://github.com/woocommerce/woocommerce/pull/46429

Method of the class: BlockTemplatesController{}

No Hooks.

Return

String.

Usage

$BlockTemplatesController = new BlockTemplatesController();
$BlockTemplatesController->update_product_archive_title( $post_type_name, $post_type );
$post_type_name(string) (required)
Post type 'name' label.
$post_type(string) (required)
Post type.

BlockTemplatesController::update_product_archive_title() code WC 9.0.1

public function update_product_archive_title( $post_type_name, $post_type ) {
	if (
		function_exists( 'is_shop' ) &&
		is_shop() &&
		'product' === $post_type
	) {
		return __( 'Shop', 'woocommerce' );
	}

	return $post_type_name;
}