WooCommerce Code Reference

WC_Breadcrumb
in package

Breadcrumb class.

Table of Contents

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

Name.

$link : string = ''

Link.

Return values
void

generate()

Generate breadcrumb trail.

public generate() : array<string|int, mixed>
Return values
array<string|int, mixed>of breadcrumbs

get_breadcrumb()

Get the breadcrumb.

public get_breadcrumb() : array<string|int, mixed>
Return values
array<string|int, mixed>

add_crumbs_post_type_archive()

Post type archive trail.

protected add_crumbs_post_type_archive() : void
Return values
void

add_crumbs_product_category()

Product category trail.

protected add_crumbs_product_category() : void
Return values
void

add_crumbs_single()

Single post trail.

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

Post ID.

$permalink : string = ''

Post permalink.

Return values
void

prepend_shop_page()

Prepend the shop page to shop breadcrumbs.

protected prepend_shop_page() : void
Return values
void

term_ancestors()

Add crumbs for a term.

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

Term ID.

$taxonomy : string

Taxonomy.

Return values
void