Yoast\WP\SEO\Generators\Schema
Author::is_needed() public Yoast 1.0
Determine whether we should return Person schema.
{} Это метод класса: Author{}
Хуков нет.
Возвращает
true/false.
Использование
$Author = new Author(); $Author->is_needed();
Код Author::is_needed() Author::is needed Yoast 15.6.2
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;
}