Function Reference: geodir_font_awesome_rating_stars_html

Summary

Display the font awesome rating icons in place of default rating images.

Package

GeoDirectory

Parameters

$html
(string) (required) Rating icons html.

Default: None
$rating
(float) (required) Current rating value.

Default: None
$star_count
(int) (required) Total rating stars.

Default: 5

Return Values

(string)
  • Rating icons html content.

Change Log

Since: 1.5.7

Source File

geodir_font_awesome_rating_stars_html() is located in geodirectory-functions/template_functions.php [Line: 649]

Source Code

function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) {
	if (get_option('geodir_reviewrating_enable_font_awesome') == '1') {
		$rating = min($rating, $star_count);
		$full_stars = floor( $rating );
		$half_stars = ceil( $rating - $full_stars );
		$empty_stars = $star_count - $full_stars - $half_stars;
		
		$html = '
'; $html .= str_repeat( '', $full_stars ); $html .= str_repeat( '', $half_stars ); $html .= str_repeat( '', $empty_stars); $html .= '
'; } return $html; }