Yoast\WP\SEO\Schema_Aggregator\Application

Schema_Aggregator_Response_Composer::composepublicYoast 1.0

Composes the final schema response.

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

Хуков нет.

Возвращает

Массив<Строку>. The composed schema response.

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

$Schema_Aggregator_Response_Composer = new Schema_Aggregator_Response_Composer();
$Schema_Aggregator_Response_Composer->compose( $schema_pieces ): array;
$schema_pieces(Schema_Piece_Collection) (обязательный)
The schema pieces to include in the response.

Код Schema_Aggregator_Response_Composer::compose() Yoast 28.3

public function compose( Schema_Piece_Collection $schema_pieces ): array {
	$composed_pieces = [];
	foreach ( $schema_pieces->to_array() as $piece ) {
		$composed_pieces[] = \array_merge(
			[
				'@context' => 'https://schema.org',
			],
			$piece->get_data(),
		);
	}
	return $composed_pieces;
}