parent
1a51989420
commit
899952e478
|
@ -48,7 +48,7 @@ class WC_Breadcrumb {
|
|||
* @return array
|
||||
*/
|
||||
public function get_breadcrumb() {
|
||||
return $this->crumbs;
|
||||
return apply_filters( 'woocommerce_get_breadcrumb', $this->crumbs, $this );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -144,7 +144,7 @@ class WC_Breadcrumb {
|
|||
if ( 'product' === get_post_type( $post ) ) {
|
||||
$this->prepend_shop_page();
|
||||
if ( $terms = wc_get_product_terms( $post->ID, 'product_cat', array( 'orderby' => 'parent', 'order' => 'DESC' ) ) ) {
|
||||
$main_term = apply_filters('woocommerce_breadcrumb_main_term', $terms[0], $terms);
|
||||
$main_term = apply_filters( 'woocommerce_breadcrumb_main_term', $terms[0], $terms );
|
||||
$this->term_ancestors( $main_term->term_id, 'product_cat' );
|
||||
$this->add_crumb( $main_term->name, get_term_link( $main_term ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue