Yoast\WP\SEO\Abilities\Application

Term_SEO_Data_Collector::get_term_seo_data │ public │ Yoast 1.0

Retrieves the SEO data for the term matching the input.

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

Хуков нет.

Возвращает

array<string, int|string|bool|null>|WP_Error. The SEO data of the term, or an error.

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

$Term_SEO_Data_Collector = new Term_SEO_Data_Collector();
$Term_SEO_Data_Collector->get_term_seo_data( $input );
$input(array<string, int|строка|true|false|null>) (обязательный)
The input containing a 'term_id' or 'permalink'.

Код Term_SEO_Data_Collector::get_term_seo_data() Yoast 28.9

public function get_term_seo_data( array $input ) {
	$indexable = $this->resolver->resolve_one( $input );

	if ( $indexable instanceof WP_Error ) {
		return $indexable;
	}

	$can_edit = $this->access_checker->ensure_can_edit( $indexable );

	if ( $can_edit instanceof WP_Error ) {
		return $can_edit;
	}

	return $this->field_map->to_seo_array( $indexable );
}