Merge pull request #2077 from GeertDD/breadcrumb

Breadcrumb
This commit is contained in:
Mike Jolley 2012-12-28 11:48:41 -08:00
commit 5f47f5e3c9
2 changed files with 14 additions and 15 deletions

View File

@ -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 . '<a href="' . get_permalink( woocommerce_get_page_id('shop') ) . '">' . get_the_title( woocommerce_get_page_id('shop') ) . '</a> ' . $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 . '<a class="home" href="' . $home_link . '">' . $home . '</a> ' . $after . $delimiter ;
echo $wrap_before;
if ( ! empty( $home ) ) {
echo $before . '<a class="home" href="' . home_url() . '">' . $home . '</a>' . $after . $delimiter;
}
if ( is_category() ) {

View File

@ -946,16 +946,16 @@ if ( ! function_exists( 'woocommerce_breadcrumb' ) ) {
*/
function woocommerce_breadcrumb( $args = array() ) {
$defaults = array(
'delimiter' => ' &rsaquo; ',
'wrap_before' => '<div id="breadcrumb" itemprop="breadcrumb">',
'wrap_after' => '</div>',
'before' => '',
'after' => '',
'home' => null
);
$defaults = apply_filters( 'woocommerce_breadcrumb_defaults', array(
'delimiter' => ' &rsaquo; ',
'wrap_before' => '<div id="breadcrumb" itemprop="breadcrumb">',
'wrap_after' => '</div>',
'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 );
}