コード例 #1
0
ファイル: metabox.php プロジェクト: kalushta/darom
 /**
  * Displays metabox content
  *
  * @param object $post
  *
  * @return void
  */
 public function display($user)
 {
     echo html('h3', __('Reports', APP_TD));
     $reports = appthemes_get_user_reports($user->ID);
     $reports = $reports->reports;
     if (empty($reports)) {
         echo '<p id="no-reports">' . __('No reports yet.', APP_TD) . '</p>';
     } else {
         $table = new APP_Reports_Table_Admin($user->ID, $reports);
         echo $table->show();
     }
 }
コード例 #2
0
ファイル: report-functions.php プロジェクト: kalushta/darom
/**
 * Retrieves the total reports for a user
 *
 * @param int $user_id The user ID to retrieve the totals from
 * @param array $args (optional) WP_Comment_Query args to be used to fetch the report collection
 * @param type $cached (optional) If set to TRUE will fetch the meta value stored in the DB
 *
 * @return type
 */
function appthemes_get_user_total_reports($user_id, $args = array(), $cached = false)
{
    $reports = appthemes_get_user_reports($user_id, $args);
    return $reports->get_total_reports($cached);
}