WC_Breadcrumb::add_crumbs_category()
Category trail.
Method of the class: WC_Breadcrumb{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->add_crumbs_category();
WC_Breadcrumb::add_crumbs_category() WC Breadcrumb::add crumbs category code 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 ) ); }