WPSEO_Primary_Term_Admin::get_primary_term_taxonomies()protectedYoast 1.0

Returns all the taxonomies for which the primary term selection is enabled.

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_primary_term_taxonomies( $post_id );
$post_id(int|null)
Default current post ID.
По умолчанию: null

Код WPSEO_Primary_Term_Admin::get_primary_term_taxonomies() Yoast 22.4

protected function get_primary_term_taxonomies( $post_id = null ) {
	if ( $post_id === null ) {
		$post_id = $this->get_current_id();
	}

	$taxonomies = wp_cache_get( 'primary_term_taxonomies_' . $post_id, 'wpseo' );
	if ( $taxonomies !== false ) {
		return $taxonomies;
	}

	$taxonomies = $this->generate_primary_term_taxonomies( $post_id );

	wp_cache_set( 'primary_term_taxonomies_' . $post_id, $taxonomies, 'wpseo' );

	return $taxonomies;
}