Yoast\WP\SEO\Abilities\Infrastructure

Post_SEO_Field_Map::indexables_to_arrayspublicYoast 1.0

Builds the post SEO data arrays for a set of indexables.

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

Хуков нет.

Возвращает

Массив. array<string, int|string|bool|null>> The post SEO data for each indexable.

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

$Post_SEO_Field_Map = new Post_SEO_Field_Map();
$Post_SEO_Field_Map->indexables_to_arrays( $indexables ): array;
$indexables(Indexable[]) (обязательный)
The indexables to read from.

Код Post_SEO_Field_Map::indexables_to_arrays() Yoast 28.3

public function indexables_to_arrays( array $indexables ): array {
	if ( $indexables !== [] ) {
		$object_ids = \array_map(
			static function ( $indexable ) {
				return (int) $indexable->object_id;
			},
			$indexables,
		);

		// Prime the post cache in one query, so each presentation build below reads its post from cache instead of issuing its own query.
		\_prime_post_caches( $object_ids, false, false );
	}

	return \array_map( [ $this, 'to_seo_array' ], $indexables );
}