WPSEO_Admin_Bar_Menu::get_post_score()protectedYoast 1.0

Gets the score for a given post.

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

Хуки из метода

Возвращает

Строку. Score markup, or empty string if none available.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_post_score( $post );
$post(WP_Post) (обязательный)
Post object to get its score.

Код WPSEO_Admin_Bar_Menu::get_post_score() Yoast 22.4

protected function get_post_score( $post ) {
	if ( ! is_object( $post ) || ! property_exists( $post, 'ID' ) ) {
		return '';
	}

	if ( apply_filters( 'wpseo_use_page_analysis', true ) !== true ) {
		return '';
	}

	return $this->get_score_icon();
}