Yoast\WP\SEO\Generators\Schema
FAQ::is_needed
Determines whether a piece should be added to the graph.
Метод класса: FAQ{}
Хуков нет.
Возвращает
true|false.
Использование
$FAQ = new FAQ(); $FAQ->is_needed();
Код FAQ::is_needed() FAQ::is needed Yoast 27.7
public function is_needed() {
if ( empty( $this->context->blocks['yoast/faq-block'] ) ) {
return false;
}
if ( ! \is_array( $this->context->schema_page_type ) ) {
$this->context->schema_page_type = [ $this->context->schema_page_type ];
}
$this->context->schema_page_type[] = 'FAQPage';
$this->context->main_entity_of_page = $this->generate_ids();
return true;
}