includes/classes/breadcrumbs.php
public function taxonomy_term_breadcrumbs( $term, $taxonomy ) {

		$term_breadcrumbs = array();

		if ( ! empty( $term ) ) {

			$term_obj = get_term( $term, $taxonomy ); // in case $term is ID, not already object

			// Current term
			$this->add_breadcrumb( $term_breadcrumbs, array(
				$term_obj->name,
				get_term_link( $term_obj, $taxonomy )
			) );

			// Parent terms?
			if ( ! empty( $term_obj->parent ) ) {

				$parent_term_breadcrumbs = array();

				// Traverse through parent terms
				$parent_term_id = $term_obj->parent;
				while ( $parent_term_id ) { // keep moving down levels until there are no more parent terms

					$parent_term = get_term( $parent_term_id, $taxonomy );
					$parent_term_id  = $parent_term->parent; // if this parent has a parent, while loop will continue

					$parent_term_breadcrumbs[] = array(
						$parent_term->name,
						get_term_link( $parent_term, $taxonomy )
					);

				}

				// Reverse parent term array and marge into main breadcrumbs
				$this->add_breadcrumbs_array( $term_breadcrumbs, $parent_term_breadcrumbs );

			}

		}

		$term_breadcrumbs = apply_filters( 'ctc_taxonomy_term_breadcrumbs', $term_breadcrumbs, $term, $taxonomy );

		return $term_breadcrumbs;

	}
public function taxonomy_term_breadcrumbs( $term, $taxonomy ) {

		$term_breadcrumbs = array();

		if ( ! empty( $term ) ) {

			$term_obj = get_term( $term, $taxonomy ); // in case $term is ID, not already object

			// Current term
			$this->add_breadcrumb( $term_breadcrumbs, array(
				$term_obj->name,
				get_term_link( $term_obj, $taxonomy )
			) );

			// Parent terms?
			if ( ! empty( $term_obj->parent ) ) {

				$parent_term_breadcrumbs = array();

				// Traverse through parent terms
				$parent_term_id = $term_obj->parent;
				while ( $parent_term_id ) { // keep moving down levels until there are no more parent terms

					$parent_term = get_term( $parent_term_id, $taxonomy );
					$parent_term_id  = $parent_term->parent; // if this parent has a parent, while loop will continue

					$parent_term_breadcrumbs[] = array(
						$parent_term->name,
						get_term_link( $parent_term, $taxonomy )
					);

				}

				// Reverse parent term array and marge into main breadcrumbs
				$this->add_breadcrumbs_array( $term_breadcrumbs, $parent_term_breadcrumbs );

			}

		}

		$term_breadcrumbs = apply_filters( 'ctc_taxonomy_term_breadcrumbs', $term_breadcrumbs, $term, $taxonomy );

		return $term_breadcrumbs;

	}
public function taxonomy_term_breadcrumbs ( $ term , $ taxonomy ) { $ term_breadcrumbs = array ( ) ; if ( ! empty ( $ term ) ) { $ term_obj = get_term ( $ term , $ taxonomy ) ; // in case $term is ID, not already object // Current term $ this -> add_breadcrumb ( $ term_breadcrumbs , array ( $ term_obj -> name , get_term_link ( $ term_obj , $ taxonomy ) ) ) ; // Parent terms? if ( ! empty ( $ term_obj -> parent ) ) { $ parent_term_breadcrumbs = array ( ) ; // Traverse through parent terms $ parent_term_id = $ term_obj -> parent ; while ( $ parent_term_id ) { // keep moving down levels until there are no more parent terms $ parent_term = get_term ( $ parent_term_id , $ taxonomy ) ; $ parent_term_id = $ parent_term -> parent ; // if this parent has a parent, while loop will continue $ parent_term_breadcrumbs [ ] = array ( $ parent_term -> name , get_term_link ( $ parent_term , $ taxonomy ) ) ; } // Reverse parent term array and marge into main breadcrumbs $ this -> add_breadcrumbs_array ( $ term_breadcrumbs , $ parent_term_breadcrumbs ) ; } } $ term_breadcrumbs = apply_filters ( 'ctc_taxonomy_term_breadcrumbs' , $ term_breadcrumbs , $ term , $ taxonomy ) ; return $ term_breadcrumbs ; }
Get taxonomy term breadcrumbs

@since 0.9
@access public
@param mixed $term Taxonomy term as ID or object
@param string $taxonomy Taxonomy slug to get breadcrumb ancestors for
@return array Breadcrumb ancestors for taxonomy term
Get taxonomy term breadcrumbs