Yoast\WP\SEO\Dashboard\Application\Score_Groups
Abstract_Score_Groups_Repository::get_score_group
Returns the score group that a score belongs to.
Метод класса: Abstract_Score_Groups_Repository{}
Хуков нет.
Возвращает
Score_Groups_Interface. The score group that the score belongs to.
Использование
$Abstract_Score_Groups_Repository = new Abstract_Score_Groups_Repository(); $Abstract_Score_Groups_Repository->get_score_group( ?int $score ): Score_Groups_Interface;
- ?int $score(обязательный)
- .
Код Abstract_Score_Groups_Repository::get_score_group() Abstract Score Groups Repository::get score group Yoast 28.9
public function get_score_group( ?int $score ): Score_Groups_Interface {
if ( $score === null || $score === 0 ) {
return $this->get_no_score_group();
}
foreach ( $this->score_groups as $score_group ) {
if ( $score_group->get_max_score() === null ) {
continue;
}
if ( $score >= $score_group->get_min_score() && $score <= $score_group->get_max_score() ) {
return $score_group;
}
}
return $this->get_no_score_group();
}