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

Yoast\WP\SEO\Generators

Schema_Generator::generate_graph() protected Yoast 1.0

Generates the schema graph.

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

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

Массив. The generated schema graph.

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

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

Код Schema_Generator::generate_graph() Yoast 17.1

protected function generate_graph( $graph_piece_generators, $context ) {
	$graph = [];
	foreach ( $graph_piece_generators as $identifier => $graph_piece_generator ) {
		$graph_pieces = $graph_piece_generator->generate();
		// If only a single graph piece was returned.
		if ( $graph_pieces !== false && \array_key_exists( '@type', $graph_pieces ) ) {
			$graph_pieces = [ $graph_pieces ];
		}

		if ( ! \is_array( $graph_pieces ) ) {
			continue;
		}

		foreach ( $graph_pieces as $graph_piece ) {
			/**
			 * Filter: 'wpseo_schema_<identifier>' - Allows changing graph piece output.
			 * This filter can be called with either an identifier or a block type (see `add_schema_blocks_graph_pieces()`).
			 *
			 * @api array $graph_piece The graph piece to filter.
			 *
			 * @param Meta_Tags_Context $context A value object with context variables.
			 * @param Abstract_Schema_Piece $graph_piece_generator A value object with context variables.
			 * @param Abstract_Schema_Piece[] $graph_piece_generators A value object with context variables.
			 */
			$graph_piece = \apply_filters( 'wpseo_schema_' . $identifier, $graph_piece, $context, $graph_piece_generator, $graph_piece_generators );
			$graph_piece = $this->type_filter( $graph_piece, $identifier, $context, $graph_piece_generator, $graph_piece_generators );
			$graph_piece = $this->validate_type( $graph_piece );

			if ( \is_array( $graph_piece ) ) {
				$graph[] = $graph_piece;
			}
		}
	}

	return $graph;
}