Yoast\WP\SEO\Builders

Indexable_Author_Builder::build()publicYoast 1.0

Formats the data.

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

Хуков нет.

Возвращает

Indexable. The extended indexable.

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

$Indexable_Author_Builder = new Indexable_Author_Builder();
$Indexable_Author_Builder->build( $user_id, $indexable );
$user_id(int) (обязательный)
The user to retrieve the indexable for.
$indexable(Indexable) (обязательный)
The indexable to format.

Код Indexable_Author_Builder::build() Yoast 24.0

public function build( $user_id, Indexable $indexable ) {
	$exception = $this->check_if_user_should_be_indexed( $user_id );
	if ( $exception ) {
		throw $exception;
	}

	$meta_data = $this->get_meta_data( $user_id );

	$indexable->object_id              = $user_id;
	$indexable->object_type            = 'user';
	$indexable->permalink              = \get_author_posts_url( $user_id );
	$indexable->title                  = $meta_data['wpseo_title'];
	$indexable->description            = $meta_data['wpseo_metadesc'];
	$indexable->is_cornerstone         = false;
	$indexable->is_robots_noindex      = ( $meta_data['wpseo_noindex_author'] === 'on' );
	$indexable->is_robots_nofollow     = null;
	$indexable->is_robots_noarchive    = null;
	$indexable->is_robots_noimageindex = null;
	$indexable->is_robots_nosnippet    = null;
	$indexable->is_public              = ( $indexable->is_robots_noindex ) ? false : null;
	$indexable->has_public_posts       = $this->author_archive->author_has_public_posts( $user_id );
	$indexable->blog_id                = \get_current_blog_id();

	$this->reset_social_images( $indexable );
	$this->handle_social_images( $indexable );

	$timestamps                      = $this->get_object_timestamps( $user_id );
	$indexable->object_published_at  = $timestamps->published_at;
	$indexable->object_last_modified = $timestamps->last_modified;

	$indexable->version = $this->version;

	return $indexable;
}