WC_Breadcrumb::add_crumbs_shop()protectedWC 1.0

Shop breadcrumb.

Method of the class: WC_Breadcrumb{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->add_crumbs_shop();

WC_Breadcrumb::add_crumbs_shop() code WC 9.3.1

protected function add_crumbs_shop() {
	if ( intval( get_option( 'page_on_front' ) ) === wc_get_page_id( 'shop' ) ) {
		return;
	}

	$_name = wc_get_page_id( 'shop' ) ? get_the_title( wc_get_page_id( 'shop' ) ) : '';

	if ( ! $_name ) {
		$product_post_type = get_post_type_object( 'product' );
		$_name             = $product_post_type->labels->name;
	}

	$this->add_crumb( $_name, get_post_type_archive_link( 'product' ) );
}