Yoast\WP\SEO\Generators\Schema

FAQ::generate_ids()privateYoast 1.0

Generate the IDs so we can link to them in the main entity.

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

Хуков нет.

Возвращает

Массив.

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

// private - только в коде основоного (родительского) класса
$result = $this->generate_ids();

Код FAQ::generate_ids() Yoast 22.4

private function generate_ids() {
	$ids = [];
	foreach ( $this->context->blocks['yoast/faq-block'] as $block ) {
		if ( isset( $block['attrs']['questions'] ) ) {
			foreach ( $block['attrs']['questions'] as $question ) {
				if ( empty( $question['jsonAnswer'] ) ) {
					continue;
				}
				$ids[] = [ '@id' => $this->context->canonical . '#' . \esc_attr( $question['id'] ) ];
			}
		}
	}

	return $ids;
}