gdrts_render_custom_stars_block()

gdrts_render_custom_stars_block($atts = array())

Description

Render stars block for a specified rating value and with custom settings. This function is not rendering rating block (active or disabled), it just simply shows a rating value as a stars block, nothing more. It is useful for showing rating in any place, where you already have rating value, and there is no need to have full rating block displayed.

Parameters

  • $aatts: array with display settings

$atts array

  • stars: the total number of stars in the block, default: 5.
  • rating: rating that needs to be displayed, default: 0.
  • style_type: render style: font, fontawesome or image, default: font.
  • style_name: name of the style element, default: star.
  • style_size: size in pixels for individual star elements
  • style_class: additional CSS class to add to the block.
  • font_color_empty: color for empty stars to use with font style.
  • font_color_current: color for current stars to use with font style.
  • title: custom text to add to the wrapper DIV title attribute.

Examples

Display rating 4/5 with this code:

<?php echo gdrts_render_custom_stars_block(
        array('rating' => 4, 
        'style_name' => 'square', 'style_size' => 24)); ?>
1
0
145
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply