wpseo_translate_score

Translates a decimal analysis score into a textual one.

Description

(string) wpseo_translate_score( (int) $val, (bool) $css_value = true ); 

Returns (string)

Parameters (2)

0. $val (int)
The decimal score to translate.
1. $css_value — Optional. (bool) => true
Whether to return the i18n translated score or the CSS class value.

Usage

  1. if ( !function_exists( 'wpseo_translate_score' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/inc/wpseo-non-ajax-functions.php'; 
  3.  
  4. // The decimal score to translate. 
  5. $val = -1; 
  6.  
  7. // Whether to return the i18n translated score or the CSS class value. 
  8. $css_value = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpseo_translate_score($val, $css_value); 
  12.  

Defined (1)

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

/inc/wpseo-non-ajax-functions.php  
  1. function wpseo_translate_score( $val, $css_value = true ) { 
  2. _deprecated_function( __FUNCTION__, 'WPSEO 1.5.6.1', 'WPSEO_Utils::translate_score()' ); 
  3.  
  4. return WPSEO_Utils::translate_score();