evolved_rating

The Evolved evolved rating function.

Description

evolved_rating( $rating ); 

Parameters (1)

0. $rating
The rating.

Usage

  1. if ( !function_exists( 'evolved_rating' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The rating. 
  5. $rating = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = evolved_rating($rating); 
  9.  

Defined (1)

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

/functions.php  
  1. function evolved_rating($rating) { 
  2.  
  3. $class = explode(".", $rating); 
  4. $output = ''; 
  5.  
  6. if($class[0] >= '10') { 
  7. $output .= '<span class="score s10">'.$rating.'</span><span class="desc">'.__('Perfect', 'evolved').'</span>'; 
  8. } elseif($class[0] >= '9') { 
  9. $output .= '<span class="score s9">'.$rating.'</span><span class="desc">'.__('Amazing', 'evolved').'</span>'; 
  10. } elseif($class[0] >= '8') { 
  11. $output .= '<span class="score s8">'.$rating.'</span><span class="desc">'.__('Great', 'evolved').'</span>'; 
  12. } elseif($class[0] >= '7') { 
  13. $output .= '<span class="score s7">'.$rating.'</span><span class="desc">'.__('Good', 'evolved').'</span>'; 
  14. } elseif($class[0] >= '6') { 
  15. $output .= '<span class="score s6">'.$rating.'</span><span class="desc">'.__('Fair', 'evolved').'</span>'; 
  16. } elseif($class[0] >= '5') { 
  17. $output .= '<span class="score s5">'.$rating.'</span><span class="desc">'.__('Mediocre', 'evolved').'</span>'; 
  18. } elseif($class[0] >= '4') { 
  19. $output .= '<span class="score s4">'.$rating.'</span><span class="desc">'.__('Poor', 'evolved').'</span>'; 
  20. } elseif($class[0] >= '3') { 
  21. $output .= '<span class="score s3">'.$rating.'</span><span class="desc">'.__('Bad', 'evolved').'</span>'; 
  22. } elseif($class[0] >= '2') { 
  23. $output .= '<span class="score s2">'.$rating.'</span><span class="desc">'.__('Terrible', 'evolved').'</span>'; 
  24. } else { 
  25. $output .= '<span class="score s1">'.$rating.'</span><span class="desc">'.__('Abysmal', 'evolved').'</span>'; 
  26. return $output;