wp_star_rating
wp_star_rating ( $args = array() )
Parameters:- (array) args { Optional. Array of star ratings arguments. @type int|float $rating The rating to display, expressed in either a 0.5 rating increment, or percentage. Default 0. @type string $type Format that the $rating is in. Valid values are 'rating' (default), or, 'percent'. Default 'rating'. @type int $number The number of ratings that makes up this rating. Default 0. @type bool $echo Whether to echo the generated markup. False to return the markup instead of echoing it. Default true. }
Returns:- (string) Star rating HTML.
Defined at:Change Log: - Introduced in WordPress: 3.8.0
- Deprecated in WordPress: —
Description
Outputs a HTML element with a star rating for a given rating.Outputs a HTML element with the star rating exposed on a 0..5 scale in
half star increments (ie. 1, 1.5, 2 stars). Optionally, if specified, the
number of ratings may also be displayed by passing the $number parameter.