WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Yoast\WP\SEO\Builders

Indexable_Term_Builder::build() public Yoast 1.0

Formats the data.

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

Хуков нет.

Возвращает

true/false/Indexable. The extended indexable. False when unable to build.

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

$Indexable_Term_Builder = new Indexable_Term_Builder();
$Indexable_Term_Builder->build( $term_id, $indexable );
$term_id(число) (обязательный)
ID of the term to save data for.
$indexable(Indexable) (обязательный)
The indexable to format.

Код Indexable_Term_Builder::build() Yoast 15.6.2

<?php
public function build( $term_id, $indexable ) {
	$term = \get_term( $term_id );

	if ( $term === null ) {
		throw new Term_Not_Found_Exception();
	}

	if ( \is_wp_error( $term ) ) {
		throw new Invalid_Term_Exception( $term->get_error_message() );
	}

	$term_link = \get_term_link( $term, $term->taxonomy );

	if ( \is_wp_error( $term_link ) ) {
		throw new Invalid_Term_Exception( $term_link->get_error_message() );
	}

	$term_meta = $this->taxonomy->get_term_meta( $term );

	$indexable->object_id       = $term_id;
	$indexable->object_type     = 'term';
	$indexable->object_sub_type = $term->taxonomy;
	$indexable->permalink       = $term_link;
	$indexable->blog_id         = \get_current_blog_id();

	$indexable->primary_focus_keyword_score = $this->get_keyword_score(
		$this->get_meta_value( 'wpseo_focuskw', $term_meta ),
		$this->get_meta_value( 'wpseo_linkdex', $term_meta )
	);

	$indexable->is_robots_noindex = $this->get_noindex_value( $this->get_meta_value( 'wpseo_noindex', $term_meta ) );
	$indexable->is_public         = ( $indexable->is_robots_noindex === null ) ? null : ! $indexable->is_robots_noindex;

	$this->reset_social_images( $indexable );

	foreach ( $this->get_indexable_lookup() as $meta_key => $indexable_key ) {
		$indexable->{$indexable_key} = $this->get_meta_value( $meta_key, $term_meta );
	}

	if ( empty( $indexable->breadcrumb_title ) ) {
		$indexable->breadcrumb_title = $term->name;
	}

	$this->handle_social_images( $indexable );

	$indexable->is_cornerstone = $this->get_meta_value( 'wpseo_is_cornerstone', $term_meta );

	// Not implemented yet.
	$indexable->is_robots_nofollow     = null;
	$indexable->is_robots_noarchive    = null;
	$indexable->is_robots_noimageindex = null;
	$indexable->is_robots_nosnippet    = null;

	return $indexable;
}