Yoast\WP\SEO\Helpers

Score_Icon_Helper::for_readability()publicYoast 1.0

Creates a Score_Icon_Presenter for the readability analysis.

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

Хуков нет.

Возвращает

Score_Icon_Presenter. The Score_Icon_Presenter.

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

$Score_Icon_Helper = new Score_Icon_Helper();
$Score_Icon_Helper->for_readability( $score, $extra_class );
$score(int) (обязательный)
The readability analysis score.
$extra_class(строка)
Any extra class.
По умолчанию: ''

Код Score_Icon_Helper::for_readability() Yoast 24.0

public function for_readability( $score, $extra_class = '' ) {
	$rank  = WPSEO_Rank::from_numeric_score( (int) $score );
	$class = $rank->get_css_class();
	if ( $extra_class ) {
		$class .= " $extra_class";
	}

	return new Score_Icon_Presenter( $rank->get_label(), $class );
}