Last active
August 29, 2015 14:13
-
-
Save zackkatz/0f160dd235049b59f775 to your computer and use it in GitHub Desktop.
Use the Netflix scale in the GravityView Ratings & Reviews Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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