Merge pull request #7514 from prowp/patch-1

Allow filter for breadcrumb terms
This commit is contained in:
Claudio Sanches 2015-02-20 23:25:37 -02:00
commit b25e51dbe6
1 changed files with 1 additions and 1 deletions

View File

@ -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 ) );
}