woocommerce_breadcrumb()
Output the WooCommerce Breadcrumb.
Hooks from the function
Return
null
. Nothing (null).
Usage
woocommerce_breadcrumb( $args );
- $args(array)
- Arguments.
Default: array()
woocommerce_breadcrumb() woocommerce breadcrumb code WC 9.2.3
function woocommerce_breadcrumb( $args = array() ) { $args = wp_parse_args( $args, apply_filters( 'woocommerce_breadcrumb_defaults', array( 'delimiter' => ' / ', 'wrap_before' => '<nav class="woocommerce-breadcrumb" aria-label="Breadcrumb">', 'wrap_after' => '</nav>', 'before' => '', 'after' => '', 'home' => _x( 'Home', 'breadcrumb', 'woocommerce' ), ) ) ); $breadcrumbs = new WC_Breadcrumb(); if ( ! empty( $args['home'] ) ) { $breadcrumbs->add_crumb( $args['home'], apply_filters( 'woocommerce_breadcrumb_home_url', home_url() ) ); } $args['breadcrumb'] = $breadcrumbs->generate(); /** * WooCommerce Breadcrumb hook * * @hooked WC_Structured_Data::generate_breadcrumblist_data() - 10 */ do_action( 'woocommerce_breadcrumb', $breadcrumbs, $args ); wc_get_template( 'global/breadcrumb.php', $args ); }