Yoast\WP\SEO\Builders
Indexable_Link_Builder::build() public Yoast 1.0
Builds the links for a post.
{} Это метод класса: Indexable_Link_Builder{}
Хуки из метода
Возвращает
SEO_Links[]. The created SEO links.
Использование
$Indexable_Link_Builder = new Indexable_Link_Builder(); $Indexable_Link_Builder->build( $indexable, $content );
- $indexable(Indexable) (обязательный)
- The indexable.
- $content(строка) (обязательный)
- The content. Expected to be unfiltered.
Код Indexable_Link_Builder::build() Indexable Link Builder::build Yoast 15.6.2
public function build( $indexable, $content ) {
if ( $indexable->object_type === 'post' ) {
$content = \apply_filters( 'the_content', $content );
}
$content = \str_replace( ']]>', ']]>', $content );
$links = $this->gather_links( $content );
$images = $this->gather_images( $content );
if ( empty( $links ) && empty( $images ) ) {
$indexable->link_count = 0;
$this->update_related_indexables( $indexable, [] );
return [];
}
$links = $this->create_links( $indexable, $links, $images );
$this->update_related_indexables( $indexable, $links );
$indexable->link_count = $this->get_internal_link_count( $links );
return $links;
}