wc_update_product_archive_title()WC 1.0

Update the product archive title to the title of the shop page. Fallback to 'Shop' if the shop page doesn't exist.

Хуков нет.

Возвращает

Строку.

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

wc_update_product_archive_title( $post_type_name, $post_type );
$post_type_name(строка) (обязательный)
Post type 'name' label.
$post_type(строка) (обязательный)
Post type.

Код wc_update_product_archive_title() WC 9.8.2

function wc_update_product_archive_title( $post_type_name, $post_type ) {
	if ( is_shop() && 'product' === $post_type ) {
		$shop_page_title = get_the_title( wc_get_page_id( 'shop' ) );
		if ( $shop_page_title ) {
			return $shop_page_title;
		}

		return __( 'Shop', 'woocommerce' );
	}

	return $post_type_name;
}