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 17.2

protected function add_schema_blocks_graph_pieces( $graph, $context ) {
	foreach ( $context->blocks as $block_type => $blocks ) {
		foreach ( $blocks as $block ) {
			$block_type = \strtolower( $block['blockName'] );
			/**
			 * Filter: 'wpseo_schema_block_<block-type>'.
			 * This filter is documented in the `generate_graph()` function in this class.
			 */
			$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;
}