WooCommerce Code Reference

WC_Breadcrumb
in package

Breadcrumb class.

Table of Contents

$crumbs  : array
Breadcrumb trail.
add_crumb()  : mixed
Add a crumb so we don't get lost.
generate()  : array
Generate breadcrumb trail.
get_breadcrumb()  : array
Get the breadcrumb.
reset()  : mixed
Reset crumbs.
add_crumbs_404()  : mixed
404 trail.
add_crumbs_attachment()  : mixed
Attachment trail.
add_crumbs_author()  : mixed
Add a breadcrumb for author archives.
add_crumbs_category()  : mixed
Category trail.
add_crumbs_date()  : mixed
Add crumbs for date based archives.
add_crumbs_home()  : mixed
Is home trail.
add_crumbs_page()  : mixed
Page trail.
add_crumbs_post_type_archive()  : mixed
Post type archive trail.
add_crumbs_product_category()  : mixed
Product category trail.
add_crumbs_product_tag()  : mixed
Product tag trail.
add_crumbs_shop()  : mixed
Shop breadcrumb.
add_crumbs_single()  : mixed
Single post trail.
add_crumbs_tag()  : mixed
Tag trail.
add_crumbs_tax()  : mixed
Add crumbs for taxonomies
endpoint_trail()  : mixed
Endpoints.
paged_trail()  : mixed
Add a breadcrumb for pagination.
prepend_shop_page()  : mixed
Prepend the shop page to shop breadcrumbs.
search_trail()  : mixed
Add a breadcrumb for search results.
term_ancestors()  : mixed
Add crumbs for a term.

Properties

Methods

add_crumb()

Add a crumb so we don't get lost.

public add_crumb(string $name[, string $link = '' ]) : mixed
Parameters
$name : string

Name.

$link : string = ''

Link.

Return values
mixed

add_crumbs_post_type_archive()

Post type archive trail.

protected add_crumbs_post_type_archive() : mixed
Return values
mixed

add_crumbs_product_category()

Product category trail.

protected add_crumbs_product_category() : mixed
Return values
mixed

add_crumbs_single()

Single post trail.

protected add_crumbs_single(int $post_id[, string $permalink = '' ]) : mixed
Parameters
$post_id : int

Post ID.

$permalink : string = ''

Post permalink.

Return values
mixed

prepend_shop_page()

Prepend the shop page to shop breadcrumbs.

protected prepend_shop_page() : mixed
Return values
mixed

term_ancestors()

Add crumbs for a term.

protected term_ancestors(int $term_id, string $taxonomy) : mixed
Parameters
$term_id : int

Term ID.

$taxonomy : string

Taxonomy.

Return values
mixed