Yoast\WP\SEO\Abilities\Application
Score_Retriever::build_seo_score_for_indexable
Builds the SEO score result for a single indexable.
Метод класса: Score_Retriever{}
Хуков нет.
Возвращает
Массив<Строку,. string|null> The SEO score data.
Использование
// private - только в коде основоного (родительского) класса $result = $this->build_seo_score_for_indexable( $indexable ): array;
- $indexable(объект) (обязательный)
- The indexable object.
Код Score_Retriever::build_seo_score_for_indexable() Score Retriever::build seo score for indexable Yoast 27.7
private function build_seo_score_for_indexable( $indexable ): array {
$title = $this->get_indexable_title( $indexable );
$rank = WPSEO_Rank::from_numeric_score( (int) $indexable->primary_focus_keyword_score );
$result = ( new Score_Result(
$title,
$rank->get_rank(),
$rank->get_label(),
) )->to_array();
$result['focus_keyphrase'] = $indexable->primary_focus_keyword;
return $result;
}