コード例 #1
0
/**
 * Prints the theme rating.
 *
 * @since  1.0.0
 * @access public
 * @param  int     $theme_id
 * @return void
 */
function thds_wporg_theme_rating($theme_id = 0)
{
    echo absint(thds_get_wporg_theme_rating($theme_id));
}
コード例 #2
0
/**
 * Filters the theme rating.
 *
 * @since  1.0.0
 * @access public
 * @param  string  $rating
 * @param  int     $theme_id
 * @return string
 */
function thds_wporg_theme_rating_filter($rating, $theme_id)
{
    if ('' === $rating) {
        $wporg_rating = thds_get_wporg_theme_rating($theme_id);
        if ($wporg_rating) {
            $rating = round(absint($wporg_rating) / 100 * 5, 2);
        }
    }
    return $rating;
}