WPSEO_Replace_Vars::get_term_hierarchy()privateYoast 1.0

Gets a taxonomy term hierarchy including the term to get the parents for.

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

Хуков нет.

Возвращает

Строку.

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

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

Код WPSEO_Replace_Vars::get_term_hierarchy() Yoast 22.3

private function get_term_hierarchy() {
	if ( ! is_taxonomy_hierarchical( $this->args->taxonomy ) ) {
		return '';
	}

	$separator = ' ' . $this->retrieve_sep() . ' ';

	$args = [
		'format'    => 'name',
		'separator' => $separator,
		'link'      => false,
		'inclusive' => true,
	];

	return rtrim(
		get_term_parents_list( $this->args->term_id, $this->args->taxonomy, $args ),
		$separator
	);
}