Yoast\WP\SEO\Dashboard\Application\Score_Results
Abstract_Score_Results_Repository::get_score_results()
Returns the score results for a content type.
Метод класса: Abstract_Score_Results_Repository{}
Хуков нет.
Возвращает
Массив<Массив<Строку,
. string|int|array<string, string>>> The scores.
Использование
$Abstract_Score_Results_Repository = new Abstract_Score_Results_Repository(); $Abstract_Score_Results_Repository->get_score_results( $content_type, ?Taxonomy $taxonomy, ?int $term_id, ?bool $is_troubleshooting ): array;
- $content_type(Content_Type) (обязательный)
- The content type.
- ?Taxonomy $taxonomy (обязательный)
- -
- ?int $term_id (обязательный)
- -
- ?bool $is_troubleshooting (обязательный)
- -
Код Abstract_Score_Results_Repository::get_score_results() Abstract Score Results Repository::get score results Yoast 24.4
public function get_score_results( Content_Type $content_type, ?Taxonomy $taxonomy, ?int $term_id, ?bool $is_troubleshooting ): array { $score_results = $this->score_results_collector->get_score_results( $this->score_groups, $content_type, $term_id, $is_troubleshooting ); if ( $is_troubleshooting === true ) { $score_results['score_ids'] = clone $score_results['scores']; foreach ( $score_results['scores'] as &$score ) { $score = ( $score !== null ) ? \count( \explode( ',', $score ) ) : 0; } } $current_scores_list = $this->current_scores_repository->get_current_scores( $this->score_groups, $score_results, $content_type, $taxonomy, $term_id ); $score_result_object = new Score_Result( $current_scores_list, $score_results['query_time'], $score_results['cache_used'] ); return $score_result_object->to_array(); }