Double shop page in breadcrumb and white space issues.

Fixes #7432
This commit is contained in:
Mike Jolley 2015-02-16 16:21:48 +00:00
parent 600b561fd9
commit bd11f51d04
4 changed files with 18 additions and 19 deletions

View File

@ -221,7 +221,6 @@ class WC_Breadcrumb {
$_name = $product_post_type->labels->singular_name;
}
$this->prepend_shop_page();
$this->add_crumb( $_name, get_post_type_archive_link( 'product' ) );
}

View File

@ -1198,7 +1198,7 @@ if ( ! function_exists( 'woocommerce_breadcrumb' ) ) {
*/
function woocommerce_breadcrumb( $args = array() ) {
$args = wp_parse_args( $args, apply_filters( 'woocommerce_breadcrumb_defaults', array(
'delimiter' => ' / ',
'delimiter' => ' / ',
'wrap_before' => '<nav class="woocommerce-breadcrumb" ' . ( is_single() ? 'itemprop="breadcrumb"' : '' ) . '>',
'wrap_after' => '</nav>',
'before' => '',

View File

@ -149,6 +149,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Stock status when updating out of stock product.
* Fix - Fix place order button text on init.
* Fix - When duplicating products, handle entities.
* Fix - Double shop page in breadcrumb and white space issues.
* Tweak - Added DOMDocument item in the System Status as a requirement.
* Tweak - Simplify default mode should be 'standard'.
* Tweak - Set attribte 'query_var' true when public.

View File

@ -11,30 +11,29 @@
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<?php if ( $breadcrumb ) : ?>
if ( $breadcrumb ) {
<?php echo $wrap_before; ?>
echo $wrap_before;
<?php foreach ( $breadcrumb as $key => $crumb ) : ?>
foreach ( $breadcrumb as $key => $crumb ) {
<?php echo $before; ?>
echo $before;
<?php if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) : ?>
<?php echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>'; ?>
<?php else : ?>
<?php echo esc_html( $crumb[0] ); ?>
<?php endif; ?>
if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) {
echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>';
} else {
echo esc_html( $crumb[0] );
}
<?php echo $after; ?>
echo $after;
<?php if ( sizeof( $breadcrumb ) !== $key + 1 ) : ?>
<?php echo $delimiter; ?>
<?php endif; ?>
if ( sizeof( $breadcrumb ) !== $key + 1 ) {
echo $delimiter;
}
<?php endforeach; ?>
}
<?php echo $wrap_after; ?>
echo $wrap_after;
<?php endif; ?>
}