Yoast\WP\SEO\Builders

Indexable_Link_Builder::get_internal_link_count()protectedYoast 1.0

Returns the number of internal links in an array of link models.

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

Хуков нет.

Возвращает

int. The number of internal links.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_internal_link_count( $links );
$links(SEO_Links[]) (обязательный)
The link models.

Код Indexable_Link_Builder::get_internal_link_count() Yoast 22.4

protected function get_internal_link_count( $links ) {
	$internal_link_count = 0;

	foreach ( $links as $link ) {
		if ( $link->type === SEO_Links::TYPE_INTERNAL ) {
			++$internal_link_count;
		}
	}

	return $internal_link_count;
}