WordPress at Your Fingertips
function is not described

WC_Breadcrumb::generate() public WC 1.0

Generate breadcrumb trail.

{} It's a method of the class: WC_Breadcrumb{}

No Hooks.

Return

Array. of breadcrumbs

Usage

$WC_Breadcrumb = new WC_Breadcrumb();
$WC_Breadcrumb->generate();

Code of WC_Breadcrumb::generate() WC 5.8.0

public function generate() {
	$conditionals = array(
		'is_home',
		'is_404',
		'is_attachment',
		'is_single',
		'is_product_category',
		'is_product_tag',
		'is_shop',
		'is_page',
		'is_post_type_archive',
		'is_category',
		'is_tag',
		'is_author',
		'is_date',
		'is_tax',
	);

	if ( ( ! is_front_page() && ! ( is_post_type_archive() && intval( get_option( 'page_on_front' ) ) === wc_get_page_id( 'shop' ) ) ) || is_paged() ) {
		foreach ( $conditionals as $conditional ) {
			if ( call_user_func( $conditional ) ) {
				call_user_func( array( $this, 'add_crumbs_' . substr( $conditional, 3 ) ) );
				break;
			}
		}

		$this->search_trail();
		$this->paged_trail();

		return $this->get_breadcrumb();
	}

	return array();
}