WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
функция не описана

Yoast\WP\SEO\Builders

Indexable_Builder::build() public Yoast 1.0

Rebuilds an Indexable from scratch.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

{} Это метод класса: Indexable_Builder{}

Хуков нет.

Возвращает

Indexable|false. The resulting Indexable.

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

$Indexable_Builder = new Indexable_Builder();
$Indexable_Builder->build( $indexable, $defaults );
$indexable(Indexable) (обязательный)
The Indexable to (re)build.
$defaults(массив|null)
The object type of the Indexable.
По умолчанию: null

Код Indexable_Builder::build() Yoast 17.7.1

public function build( $indexable, $defaults = null ) {
	// Backup the previous Indexable, if there was one.
	$indexable_before = ( $indexable ) ? $this->deep_copy_indexable( $indexable ) : null;

	// Make sure we have an Indexable to work with.
	$indexable = $this->ensure_indexable( $indexable, $defaults );

	try {
		switch ( $indexable->object_type ) {

			case 'post':
				$indexable = $this->post_builder->build( $indexable->object_id, $indexable );
				if ( ! $indexable ) {
					// Indexable for this Post was not built for a reason; e.g. if its post type is excluded.
					return $indexable;
				}

				// Always rebuild the primary term.
				$this->primary_term_builder->build( $indexable->object_id );

				// Always rebuild the hierarchy; this needs the primary term to run correctly.
				$this->hierarchy_builder->build( $indexable );

				// Rebuild the author indexable only when necessary.
				$author_indexable = $this->indexable_repository->find_by_id_and_type(
					$indexable->author_id,
					'user',
					false
				);
				if ( ! $author_indexable || $this->version_manager->indexable_needs_upgrade( $author_indexable ) ) {
					$author_defaults = [
						'object_type' => 'user',
						'object_id'   => $indexable->author_id,
					];
					$this->build( $author_indexable, $author_defaults );
				}
				break;

			case 'user':
				$indexable = $this->author_builder->build( $indexable->object_id, $indexable );
				break;

			case 'term':
				$indexable = $this->term_builder->build( $indexable->object_id, $indexable );
				$this->hierarchy_builder->build( $indexable );
				break;

			case 'home-page':
				$indexable = $this->home_page_builder->build( $indexable );
				break;

			case 'date-archive':
				$indexable = $this->date_archive_builder->build( $indexable );
				break;

			case 'post-type-archive':
				$indexable = $this->post_type_archive_builder->build( $indexable->object_sub_type, $indexable );
				break;

			case 'system-page':
				$indexable = $this->system_page_builder->build( $indexable->object_sub_type, $indexable );
				break;
		}

		return $this->save_indexable( $indexable, $indexable_before );
	}
	catch ( Source_Exception $exception ) {
		/**
		 * The current indexable could not be indexed. Create a placeholder indexable, so we can
		 * skip this indexable in future indexing runs.
		 *
		 * @var Indexable $indexable
		 */
		$indexable = $this->indexable_repository
			->query()
			->create(
				[
					'object_id'   => $indexable->object_id,
					'object_type' => $indexable->object_type,
					'post_status' => 'unindexed',
					'version'     => 0,
				]
			);
		// Make sure that the indexing process doesn't get stuck in a loop on this broken indexable.
		$indexable = $this->version_manager->set_latest( $indexable );

		return $this->save_indexable( $indexable, $indexable_before );
	}
}