Yoast\WP\SEO\Abilities\Application

Post_SEO_Data_Collector::get_post_seo_datapublicYoast 1.0

Retrieves the SEO data for the posts matching the input.

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

Хуков нет.

Возвращает

Массив. array<string, int|string|bool|null>>|WP_Error The SEO data for each matching post, or an error.

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

$Post_SEO_Data_Collector = new Post_SEO_Data_Collector();
$Post_SEO_Data_Collector->get_post_seo_data( $input );
$input(массив) (обязательный)
.

Код Post_SEO_Data_Collector::get_post_seo_data() Yoast 28.2

public function get_post_seo_data( array $input ) {
	$indexables = $this->resolver->resolve_many( $input );

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

	$editable = $this->post_access_checker->filter_editable( $indexables );

	// Every match was a post the user may not edit; an already empty match list
	// (a title-search page past the last result) stays a valid empty result.
	if ( $editable === [] && $indexables !== [] ) {
		return $this->post_access_checker->forbidden_error();
	}

	return $this->field_map->indexables_to_arrays( $editable );
}