original_string: public function term_link( $termlink, $term, $taxonomy ) {
  		/**
  		 * WP_Rewrite.
  		 *
  		 * @var WP_Rewrite $wp_rewrite
  		 */
  		global $wp_rewrite;
  
  		if ( ! $wp_rewrite->permalink_structure ) {
  			return $termlink;
  		}
  
  		if ( CPTP_Util::get_no_taxonomy_structure() ) {
  			return $termlink;
  		}
  
  		$taxonomy = get_taxonomy( $taxonomy );
  
  		if ( empty( $taxonomy ) ) {
  			return $termlink;
  		}
  
  		if ( $taxonomy->_builtin ) {
  			return $termlink;
  		}
  
  		if ( ! $taxonomy->public ) {
  			return $termlink;
  		}
  
  		$wp_home = rtrim( home_url(), '/' );
  
  		if ( in_array( get_post_type(), $taxonomy->object_type, true ) ) {
  			$post_type = get_post_type();
  		} else {
  			$post_type = $taxonomy->object_type[0];
  		}
  
  		$front         = substr( $wp_rewrite->front, 1 );
  		$termlink      = str_replace( $front, '', $termlink );// remove front.
  
  		$post_type_obj = get_post_type_object( $post_type );
  
  		if ( empty( $post_type_obj ) ) {
  			return $termlink;
  		}
  
  		$slug          = $post_type_obj->rewrite['slug'];
  		$with_front    = $post_type_obj->rewrite['with_front'];
  
  		if ( $with_front ) {
  			$slug = $front . $slug;
  		}
  
  		if ( ! empty( $slug ) ) {
  			$termlink = str_replace( $wp_home, $wp_home . '/' . $slug, $termlink );
  		}
  
  		if ( ! $taxonomy->rewrite['hierarchical'] ) {
  			$termlink = str_replace( $term->slug . '/', CPTP_Util::get_taxonomy_parents_slug( $term->term_id, $taxonomy->name, '/', true ), $termlink );
  		}
  
  		return $termlink;
  	}
code: public function term_link( $termlink, $term, $taxonomy ) {
  		/**
  		 * WP_Rewrite.
  		 *
  		 * @var WP_Rewrite $wp_rewrite
  		 */
  		global $wp_rewrite;
  
  		if ( ! $wp_rewrite->permalink_structure ) {
  			return $termlink;
  		}
  
  		if ( CPTP_Util::get_no_taxonomy_structure() ) {
  			return $termlink;
  		}
  
  		$taxonomy = get_taxonomy( $taxonomy );
  
  		if ( empty( $taxonomy ) ) {
  			return $termlink;
  		}
  
  		if ( $taxonomy->_builtin ) {
  			return $termlink;
  		}
  
  		if ( ! $taxonomy->public ) {
  			return $termlink;
  		}
  
  		$wp_home = rtrim( home_url(), '/' );
  
  		if ( in_array( get_post_type(), $taxonomy->object_type, true ) ) {
  			$post_type = get_post_type();
  		} else {
  			$post_type = $taxonomy->object_type[0];
  		}
  
  		$front         = substr( $wp_rewrite->front, 1 );
  		$termlink      = str_replace( $front, '', $termlink );// remove front.
  
  		$post_type_obj = get_post_type_object( $post_type );
  
  		if ( empty( $post_type_obj ) ) {
  			return $termlink;
  		}
  
  		$slug          = $post_type_obj->rewrite['slug'];
  		$with_front    = $post_type_obj->rewrite['with_front'];
  
  		if ( $with_front ) {
  			$slug = $front . $slug;
  		}
  
  		if ( ! empty( $slug ) ) {
  			$termlink = str_replace( $wp_home, $wp_home . '/' . $slug, $termlink );
  		}
  
  		if ( ! $taxonomy->rewrite['hierarchical'] ) {
  			$termlink = str_replace( $term->slug . '/', CPTP_Util::get_taxonomy_parents_slug( $term->term_id, $taxonomy->name, '/', true ), $termlink );
  		}
  
  		return $termlink;
  	}
code_tokens: public function term_link ( $ termlink , $ term , $ taxonomy ) { /**
  		 * WP_Rewrite.
  		 *
  		 * @var WP_Rewrite $wp_rewrite
  		 */ global $ wp_rewrite ; if ( ! $ wp_rewrite -> permalink_structure ) { return $ termlink ; } if ( CPTP_Util :: get_no_taxonomy_structure ( ) ) { return $ termlink ; } $ taxonomy = get_taxonomy ( $ taxonomy ) ; if ( empty ( $ taxonomy ) ) { return $ termlink ; } if ( $ taxonomy -> _builtin ) { return $ termlink ; } if ( ! $ taxonomy -> public ) { return $ termlink ; } $ wp_home = rtrim ( home_url ( ) , '/' ) ; if ( in_array ( get_post_type ( ) , $ taxonomy -> object_type , true ) ) { $ post_type = get_post_type ( ) ; } else { $ post_type = $ taxonomy -> object_type [ 0 ] ; } $ front = substr ( $ wp_rewrite -> front , 1 ) ; $ termlink = str_replace ( $ front , '' , $ termlink ) ; // remove front. $ post_type_obj = get_post_type_object ( $ post_type ) ; if ( empty ( $ post_type_obj ) ) { return $ termlink ; } $ slug = $ post_type_obj -> rewrite [ 'slug' ] ; $ with_front = $ post_type_obj -> rewrite [ 'with_front' ] ; if ( $ with_front ) { $ slug = $ front . $ slug ; } if ( ! empty ( $ slug ) ) { $ termlink = str_replace ( $ wp_home , $ wp_home . '/' . $ slug , $ termlink ) ; } if ( ! $ taxonomy -> rewrite [ 'hierarchical' ] ) { $ termlink = str_replace ( $ term -> slug . '/' , CPTP_Util :: get_taxonomy_parents_slug ( $ term -> term_id , $ taxonomy -> name , '/' , true ) , $ termlink ) ; } return $ termlink ; }
docstring: Fix taxonomy link outputs.
  
  @since 0.6
  @version 1.0
  
  @param string $termlink link URI.
  @param Object $term Term Object.
  @param Object $taxonomy Taxonomy Object.
  
  @return string
docstring_tokens: Fix taxonomy link outputs .