wpseo_adminbar_score

Takes The SEO score and makes the score icon for the adminbar with it.

Description

(string) wpseo_adminbar_score( (int) $score ); 

Returns (string)

$score_adminbar_element

Parameters (1)

0. $score (int)
The 0-100 rating of the score. Can be either SEO score or content score.

Usage

  1. if ( !function_exists( 'wpseo_adminbar_score' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/inc/wpseo-non-ajax-functions.php'; 
  3.  
  4. // The 0-100 rating of the score. Can be either SEO score or content score. 
  5. $score = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpseo_adminbar_score($score); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/wpseo-non-ajax-functions.php  
  1. function wpseo_adminbar_score( $score ) { 
  2. $score = WPSEO_Utils::translate_score( $score ); 
  3.  
  4. $score_adminbar_element = '<div class="wpseo-score-icon adminbar-seo-score ' . $score . '"><span class="adminbar-seo-score-text screen-reader-text"></span></div>'; 
  5. return $score_adminbar_element;