Yoast\WP\SEO\Generators\Schema

FAQ::is_needed()publicYoast 1.0

Determines whether a piece should be added to the graph.

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

Хуков нет.

Возвращает

true|false.

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

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

Код FAQ::is_needed() Yoast 22.4

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;
}