Merge pull request #7514 from prowp/patch-1
Allow filter for breadcrumb terms
This commit is contained in:
commit
b25e51dbe6
|
@ -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 = $terms[0];
|
||||
$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