Yoast\WP\SEO\Generators\Schema

Author::is_needed()publicYoast 1.0

Determine whether we should return Person schema.

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

Хуков нет.

Возвращает

true|false.

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

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

Код Author::is_needed() Yoast 22.4

public function is_needed() {
	if ( $this->context->indexable->object_type === 'user' ) {
		return true;
	}

	if (
		$this->context->indexable->object_type === 'post'
		&& $this->helpers->schema->article->is_author_supported( $this->context->indexable->object_sub_type )
		&& $this->context->schema_article_type !== 'None'
	) {
		return true;
	}

	return false;
}