diff --git a/templates/shop/breadcrumb.php b/templates/shop/breadcrumb.php index ab4ee1c3976..12bd8c87c0e 100644 --- a/templates/shop/breadcrumb.php +++ b/templates/shop/breadcrumb.php @@ -11,11 +11,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $post, $wp_query; -if( ! $home ) - $home = _x( 'Home', 'breadcrumb', 'woocommerce' ); - -$home_link = home_url(); - if ( get_option('woocommerce_prepend_shop_page_to_urls') == "yes" && woocommerce_get_page_id( 'shop' ) && get_option( 'page_on_front' ) !== woocommerce_get_page_id( 'shop' ) ) $prepend = $before . '' . get_the_title( woocommerce_get_page_id('shop') ) . ' ' . $after . $delimiter; else @@ -23,7 +18,11 @@ else if ( ( ! is_home() && ! is_front_page() && ! ( is_post_type_archive() && get_option( 'page_on_front' ) == woocommerce_get_page_id( 'shop' ) ) ) || is_paged() ) { - echo $wrap_before . $before . '' . $home . ' ' . $after . $delimiter ; + echo $wrap_before; + + if ( ! empty( $home ) ) { + echo $before . '' . $home . '' . $after . $delimiter; + } if ( is_category() ) { diff --git a/woocommerce-template.php b/woocommerce-template.php index c719ac984f2..3eca6383ba6 100644 --- a/woocommerce-template.php +++ b/woocommerce-template.php @@ -946,16 +946,16 @@ if ( ! function_exists( 'woocommerce_breadcrumb' ) ) { */ function woocommerce_breadcrumb( $args = array() ) { - $defaults = array( - 'delimiter' => ' › ', - 'wrap_before' => '', - 'before' => '', - 'after' => '', - 'home' => null - ); + $defaults = apply_filters( 'woocommerce_breadcrumb_defaults', array( + 'delimiter' => ' › ', + 'wrap_before' => '', + 'before' => '', + 'after' => '', + 'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ), + ) ); - $args = wp_parse_args( $args, $defaults ); + $args = wp_parse_args( $args, $defaults ); woocommerce_get_template( 'shop/breadcrumb.php', $args ); }