WPSEO_Primary_Term_Admin::get_primary_term()protectedYoast 1.0

Gets the id of the primary term.

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

Хуков нет.

Возвращает

int. primary term id

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_primary_term( $taxonomy_name );
$taxonomy_name(строка) (обязательный)
Taxonomy name for the term.

Код WPSEO_Primary_Term_Admin::get_primary_term() Yoast 22.4

protected function get_primary_term( $taxonomy_name ) {
	$primary_term = new WPSEO_Primary_Term( $taxonomy_name, $this->get_current_id() );

	return $primary_term->get_primary_term();
}