WPSEO_Slug_Change_Watcher::get_taxonomy_label_for_term()protectedYoast 1.0

Gets the taxonomy label to use for a term.

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

Хуков нет.

Возвращает

Строку. The taxonomy's singular label.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_taxonomy_label_for_term( $term_id );
$term_id(int) (обязательный)
The term ID.

Код WPSEO_Slug_Change_Watcher::get_taxonomy_label_for_term() Yoast 22.4

protected function get_taxonomy_label_for_term( $term_id ) {
	$term     = get_term( $term_id );
	$taxonomy = get_taxonomy( $term->taxonomy );

	return $taxonomy->labels->singular_name;
}