I always thought WordPress was missing a good star rating function. I don’t know why it’s not built into PHP itself, frankly. Thank god that wp_star_rating() exists.
Why do something yourself when someone else can do it for you? If you’re thinking to yourself, “Yeah, spit that wisdom yo”, then wp_star_rating() is for you.
I’m not even going to explain it. I will point out that the function is only available in the admin panel. The Notes section has this useful… note:
In order to use this function on the front end, your template must include the wp-admin/includes/template.php file and enqueue the appropriate dashicons CSS font information.
It also includes some example CSS to get you going, in case you’re feeling exceptionally lazy today.