Yoast\WP\SEO\Generators\Schema

FAQ::generate()publicYoast 1.0

Render a list of questions, referencing them by ID.

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

Хуков нет.

Возвращает

Массив. Our Schema graph.

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

$FAQ = new FAQ();
$FAQ->generate();

Код FAQ::generate() Yoast 18.8

public function generate() {
	$graph = [];

	$questions = [];
	foreach ( $this->context->blocks['yoast/faq-block'] as $index => $block ) {
		$questions = \array_merge( $questions, $block['attrs']['questions'] );
	}
	foreach ( $questions as $index => $question ) {
		if ( ! isset( $question['jsonAnswer'] ) || empty( $question['jsonAnswer'] ) ) {
			continue;
		}
		$graph[] = $this->generate_question_block( $question, ( $index + 1 ) );
	}

	return $graph;
}