Permalink
Browse files

Added filters to gives possibility to specify which term to use to ge…

…nerate permalin/breadcrumb for product
  • Loading branch information...
1 parent 40f7307 commit c7efa0955146201ee4c96c3d635c1a1f570ae7b8 @annzaan annzaan committed Dec 21, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 jigoshop.php
  2. +1 −1 jigoshop_template_functions.php
View
2 jigoshop.php
@@ -564,7 +564,7 @@ function jigoshop_product_cat_filter_post_link( $permalink, $post, $leavename, $
$permalink = str_replace( '%product_cat%', _x('product', 'slug', 'jigoshop'), $permalink );
else :
// Replace the placeholder rewrite tag with the first term's slug
- $first_term = array_shift( $terms );
+ $first_term = apply_filters( 'jigoshop_product_cat_permalink_terms', array_shift( $terms ), $terms);
$permalink = str_replace( '%product_cat%', $first_term->slug, $permalink );
endif;
View
2 jigoshop_template_functions.php
@@ -996,7 +996,7 @@ function jigoshop_breadcrumb( $delimiter = ' &rsaquo; ', $wrap_before = '<div id
echo $prepend;
if ($terms = get_the_terms( $post->ID, 'product_cat' )) :
- $term = current($terms);
+ $term = apply_filters( 'jigoshop_product_cat_breadcrumb_terms', current($terms), $terms);
$parents = array();
$parent = $term->parent;
while ($parent):

0 comments on commit c7efa09

Please sign in to comment.