Yoast\WP\SEO\Generators\Schema
FAQ::generate_ids
Generate the IDs so we can link to them in the main entity.
Метод класса: FAQ{}
Хуков нет.
Возвращает
Массив.
Использование
// private - только в коде основоного (родительского) класса $result = $this->generate_ids();
Код FAQ::generate_ids() FAQ::generate ids Yoast 26.9
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;
}