Exemple #1
0
/**
 * Prints the theme download count.
 *
 * @since  1.0.0
 * @access public
 * @param  int     $theme_id
 * @return void
 */
function thds_theme_download_count($theme_id = 0)
{
    echo number_format_i8n(absint(thds_get_theme_download_count($theme_id)));
}
 /**
  * Displays the content of custom theme columns on the edit screen.
  *
  * @since  1.0.0
  * @access public
  * @param  string  $column
  * @param  int     $post_id
  * @return void
  */
 public function custom_column($column, $post_id)
 {
     if ('screenshot' === $column) {
         if (has_post_thumbnail()) {
             the_post_thumbnail(array(75, 75));
         } elseif (function_exists('get_the_image')) {
             get_the_image(array('scan' => true, 'width' => 75, 'link' => false));
         }
     } else {
         if ('downloads' === $column) {
             $count = thds_get_theme_download_count($post_id);
             echo $count ? number_format_i18n($count) : '–';
         } else {
             if ('rating' === $column) {
                 $rating = thds_get_theme_rating($post_id);
                 $number = thds_get_theme_rating_count($post_id);
                 wp_star_rating(array('type' => 'rating', 'rating' => floatval($rating), 'number' => absint($number)));
             }
         }
     }
 }