function dwqa_question_columns_content($column_name, $post_ID) { switch ($column_name) { case 'info': echo ucfirst(get_post_meta($post_ID, '_dwqa_status', true)) . '<br>'; echo '<strong>' . dwqa_question_answers_count($post_ID) . '</strong> ' . __('answered', 'dwqa') . '<br>'; echo '<strong>' . dwqa_vote_count($post_ID) . '</strong> ' . __('voted', 'dwqa') . '<br>'; echo '<strong>' . dwqa_question_views_count($post_ID) . '</strong> ' . __('views', 'dwqa') . '<br>'; break; case 'question-category': $terms = wp_get_post_terms($post_ID, 'dwqa-question_category'); $i = 0; foreach ($terms as $term) { if ($i > 0) { echo ', '; } echo '<a href="' . get_term_link($term, 'dwqa-question_category') . '">' . $term->name . '</a> '; $i++; } break; case 'question-tag': $terms = wp_get_post_terms($post_ID, 'dwqa-question_tag'); $i = 0; foreach ($terms as $term) { if ($i > 0) { echo ', '; } echo '<a href="' . get_term_link($term, 'dwqa-question_tag') . '">' . $term->name . '</a> '; $i++; } break; } }
if ($latest_answer) { $time = human_time_diff(strtotime($latest_answer->post_date)); $text = __('answered', 'dwqa'); } ?> <?php printf(__('<span><a href="%s">%s%s</a> %s %s ago</span>', 'dwqa'), dwqa_get_author_link($user_id), get_avatar($user_id, 48), dwqa_get_author(), $text, $time); ?> <?php echo get_the_term_list(get_the_ID(), 'dwqa-question_category', '<span class="dwqa-question-category">' . __(' • ', 'dwqa'), ', ', '</span>'); ?> </div> <div class="dwqa-question-stats"> <span class="dwqa-views-count"> <?php $views_count = dwqa_question_views_count(); ?> <?php printf(__('<strong>%1$s</strong> views', 'dwqa'), $views_count); ?> </span> <span class="dwqa-answers-count"> <?php $answers_count = dwqa_question_answers_count(); ?> <?php printf(__('<strong>%1$s</strong> answers', 'dwqa'), $answers_count); ?> </span> <span class="dwqa-votes-count"> <?php