public static function get_taxonomy_parents_slug( $term, $taxonomy = 'category', $separator = '/', $nicename = false, $visited = array() ) {
		$chain  = '';
		$parent = get_term( $term, $taxonomy );
		if ( is_wp_error( $parent ) ) {
			return $parent;
		}

		if ( $nicename ) {
			$name = $parent->slug;
		} else {
			$name = $parent->name;
		}

		if ( $parent->parent && ( $parent->parent !== $parent->term_id ) && ! in_array( $parent->parent, $visited, true ) ) {
			$visited[] = $parent->parent;
			$chain     .= CPTP_Util::get_taxonomy_parents_slug( $parent->parent, $taxonomy, $separator, $nicename, $visited );
		}
		$chain .= $name . $separator;

		return $chain;
	}
public static function get_taxonomy_parents_slug( $term, $taxonomy = 'category', $separator = '/', $nicename = false, $visited = array() ) {
		$chain  = '';
		$parent = get_term( $term, $taxonomy );
		if ( is_wp_error( $parent ) ) {
			return $parent;
		}

		if ( $nicename ) {
			$name = $parent->slug;
		} else {
			$name = $parent->name;
		}

		if ( $parent->parent && ( $parent->parent !== $parent->term_id ) && ! in_array( $parent->parent, $visited, true ) ) {
			$visited[] = $parent->parent;
			$chain     .= CPTP_Util::get_taxonomy_parents_slug( $parent->parent, $taxonomy, $separator, $nicename, $visited );
		}
		$chain .= $name . $separator;

		return $chain;
	}
public static function get_taxonomy_parents_slug ( $ term , $ taxonomy = 'category' , $ separator = '/' , $ nicename = false , $ visited = array ( ) ) { $ chain = '' ; $ parent = get_term ( $ term , $ taxonomy ) ; if ( is_wp_error ( $ parent ) ) { return $ parent ; } if ( $ nicename ) { $ name = $ parent -> slug ; } else { $ name = $ parent -> name ; } if ( $ parent -> parent && ( $ parent -> parent !== $ parent -> term_id ) && ! in_array ( $ parent -> parent , $ visited , true ) ) { $ visited [ ] = $ parent -> parent ; $ chain .= CPTP_Util :: get_taxonomy_parents_slug ( $ parent -> parent , $ taxonomy , $ separator , $ nicename , $ visited ) ; } $ chain .= $ name . $ separator ; return $ chain ; }
Get Custom Taxonomies parents slug.

@version 1.0

@param int|WP_Term|object $term Target term.
@param string             $taxonomy Taxonomy name.
@param string             $separator separater string.
@param bool               $nicename use slug or name.
@param array              $visited visited parent slug.

@return string
Get Custom Taxonomies parents slug .