WC_Breadcrumb::add_crumbs_category()protectedWC 1.0

Category trail.

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

Хуков нет.

Возвращает

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

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

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

Код WC_Breadcrumb::add_crumbs_category() WC 8.7.0

protected function add_crumbs_category() {
	$this_category = get_category( $GLOBALS['wp_query']->get_queried_object() );

	if ( 0 !== intval( $this_category->parent ) ) {
		$this->term_ancestors( $this_category->term_id, 'category' );
	}

	$this->add_crumb( single_cat_title( '', false ), get_category_link( $this_category->term_id ) );
}