WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Yoast\WP\SEO\Generators

Schema_Generator::add_schema_blocks_graph_pieces() protected Yoast 1.0

Adds schema graph pieces from Gutenberg blocks on the current page to the given schema graph.

Think of blocks like the Yoast FAQ block or the How To block.

{} Это метод класса: Schema_Generator{}

Хуки из метода
Возвращает

Массив. The graph with the schema blocks graph pieces added.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_schema_blocks_graph_pieces( $graph, $context );
$graph(массив) (обязательный)
The current schema graph.
$context(Meta_Tags_Context) (обязательный)
The meta tags context.

Код Schema_Generator::add_schema_blocks_graph_pieces() Yoast 15.6.2

<?php
protected function add_schema_blocks_graph_pieces( $graph, $context ) {
	foreach ( $context->blocks as $block_type => $blocks ) {
		foreach ( $blocks as $block ) {
			/**
			 * Filter: 'wpseo_schema_block_<block-type>' - Allows filtering graph output per block.
			 *
			 * @api array $graph Our Schema output.
			 *
			 * @param WP_Block_Parser_Block $block   The block.
			 * @param Meta_Tags_Context     $context A value object with context variables.
			 */
			$block_type = \strtolower( $block['blockName'] );
			$graph      = \apply_filters( 'wpseo_schema_block_' . $block_type, $graph, $block, $context );

			if ( isset( $block['attrs']['yoast-schema'] ) ) {
				$graph[] = $this->schema_replace_vars_helper->replace( $block['attrs']['yoast-schema'], $context->presentation );
			}
		}
	}

	return $graph;
}