Automattic\WooCommerce\Blocks

CoreBreadcrumbsCompatibility::prepend_shop_page_to_product_search_breadcrumbs │ private │ WC 1.0

Prepend the shop page to product search breadcrumbs.

Method of the class: CoreBreadcrumbsCompatibility{}

No Hooks.

Returns

array. Modified breadcrumb items.

Usage

// private - for code of main (parent) class only
$result = $this->prepend_shop_page_to_product_search_breadcrumbs( $items );
$items(array) (required)
Array of breadcrumb items from Core.

CoreBreadcrumbsCompatibility::prepend_shop_page_to_product_search_breadcrumbs() code WC 11.1.2

private function prepend_shop_page_to_product_search_breadcrumbs( $items ) {
	if ( ! $this->is_product_search() || intval( get_option( 'page_on_front' ) ) === wc_get_page_id( 'shop' ) ) {
		return $items;
	}

	return $this->prepend_shop_page_to_breadcrumbs( $items );
}