Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackkatz/0f160dd235049b59f775 to your computer and use it in GitHub Desktop.
Save zackkatz/0f160dd235049b59f775 to your computer and use it in GitHub Desktop.
Use the Netflix scale in the GravityView Ratings & Reviews Extension
<?php
/**
* Change the titles displayed when hovering over a star to use the Netflix scale
* @param array $stars Star titles
* @return array Modified titles
*/
function gv_ratings_reviews_use_netflix_scale( $stars ) {
// Make sure to keep the array key numbers intact; they map with the star rating.
// You can also set an empty string to disable the title attribute from appearing.
$stars = array(
1 => 'Hated it',
2 => 'Didn\'t like it',
3 => 'It was okay',
4 => 'Liked it',
5 => 'Loved it',
);
return $stars;
}
add_filter('gv_ratings_reviews_star_rating_titles', 'gv_ratings_reviews_use_netflix_scale');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment