WC_Breadcrumb::add_crumbs_tax()protectedWC 1.0

Add crumbs for taxonomies

Метод класса: WC_Breadcrumb{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_crumbs_tax();

Код WC_Breadcrumb::add_crumbs_tax() WC 8.7.0

protected function add_crumbs_tax() {
	$this_term = $GLOBALS['wp_query']->get_queried_object();
	$taxonomy  = get_taxonomy( $this_term->taxonomy );

	$this->add_crumb( $taxonomy->labels->name );

	if ( 0 !== intval( $this_term->parent ) ) {
		$this->term_ancestors( $this_term->term_id, $this_term->taxonomy );
	}

	$this->add_crumb( single_term_title( '', false ), get_term_link( $this_term->term_id, $this_term->taxonomy ) );
}