WPSEO_Rank::from_numeric_score()public staticYoast 1.0

Returns a rank for a specific numeric score.

{} Это метод класса: WPSEO_Rank{}

Хуков нет.

Возвращает

self.

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

$result = WPSEO_Rank::from_numeric_score( $score );
$score(int) (обязательный)
The score to determine a rank for.

Код WPSEO_Rank::from_numeric_score() Yoast 19.7.1

public static function from_numeric_score( $score ) {
	// Set up the default value.
	$rank = new self( self::BAD );

	foreach ( self::$ranges as $rank_index => $range ) {
		if ( $range['start'] <= $score && $score <= $range['end'] ) {
			$rank = new self( $rank_index );
			break;
		}
	}

	return $rank;
}