/**
 * Get tickets lit columns content.
 *
 * Based on the columns displayed in the front-end tickets list,
 * this function will display the column content by using its callback.
 * The callback can be a "standard" case like the title, or a custom function
 * as used by the custom fields mostly.
 *
 * @since  3.0.0
 * @param  string $column_id ID of the current column
 * @param  array  $column    Columns data
 * @return void
 */
function wpas_get_tickets_list_column_content($column_id, $column)
{
    $callback = $column['callback'];
    switch ($callback) {
        case 'id':
            echo '#' . get_the_ID();
            break;
        case 'status':
            echo wpas_get_ticket_status(get_the_ID());
            break;
        case 'title':
            // If the replies are displayed from the oldest to the newest we want to link directly to the latest reply in case there are multiple reply pages
            if ('ASC' === wpas_get_option('replies_order', 'ASC')) {
                $last_reply = wpas_get_replies(get_the_ID(), array('read', 'unread'), array('posts_per_page' => 1, 'order' => 'DESC'));
                $link = !empty($last_reply) ? wpas_get_reply_link($last_reply[0]->ID) : get_permalink(get_the_ID());
            } else {
                $link = get_permalink(get_the_ID());
            }
            ?>
<a href="<?php 
            echo $link;
            ?>
"><?php 
            the_title();
            ?>
</a><?php 
            break;
        case 'date':
            $offset = wpas_get_offset_html5();
            ?>
<time datetime="<?php 
            echo get_the_date('Y-m-d\\TH:i:s') . $offset;
            ?>
"><?php 
            echo get_the_date(get_option('date_format')) . ' ' . get_the_date(get_option('time_format'));
            ?>
</time><?php 
            break;
        case 'taxonomy':
            $terms = get_the_terms(get_the_ID(), $column_id);
            $list = array();
            if (empty($terms)) {
                continue;
            }
            foreach ($terms as $term) {
                array_push($list, $term->name);
            }
            echo implode(', ', $list);
            break;
        default:
            if (function_exists($callback)) {
                call_user_func($callback, $column_id, get_the_ID());
            }
            break;
    }
}
/**
 * Get tickets lit columns content.
 *
 * Based on the columns displayed in the front-end tickets list,
 * this function will display the column content by using its callback.
 * The callback can be a "standard" case like the title, or a custom function
 * as used by the custom fields mostly.
 *
 * @since  3.0.0
 * @param  string $column_id ID of the current column
 * @param  array  $column    Columns data
 * @return void
 */
function wpas_get_tickets_list_column_content($column_id, $column)
{
    $callback = $column['callback'];
    switch ($callback) {
        case 'id':
            echo '#' . get_the_ID();
            break;
        case 'status':
            echo wpas_get_ticket_status(get_the_ID());
            break;
        case 'title':
            ?>
<a href="<?php 
            echo get_permalink(get_the_ID());
            ?>
"><?php 
            the_title();
            ?>
</a><?php 
            break;
        case 'date':
            $offset = wpas_get_offset_html5();
            ?>
<time datetime="<?php 
            echo get_the_date('Y-m-d\\TH:i:s') . $offset;
            ?>
"><?php 
            echo get_the_date(get_option('date_format')) . ' ' . get_the_date(get_option('time_format'));
            ?>
</time><?php 
            break;
        case 'taxonomy':
            $terms = get_the_terms(get_the_ID(), $column_id);
            $list = array();
            if (empty($terms)) {
                continue;
            }
            foreach ($terms as $term) {
                array_push($list, $term->name);
            }
            echo implode(', ', $list);
            break;
        default:
            if (function_exists($callback)) {
                call_user_func($callback, $column_id, get_the_ID());
            }
            break;
    }
}
Exemple #3
0
echo get_avatar($post->post_author, '64', get_option('avatar_default'));
?>
					</div>
				</td>

				<td>
					<div class="wpas-reply-meta">
						<div class="wpas-reply-user">
							<strong class="wpas-profilename"><?php 
echo $author->data->display_name;
?>
</strong>
						</div>
						<div class="wpas-reply-time">
							<time class="wpas-timestamp" datetime="<?php 
echo get_the_date('Y-m-d\\TH:i:s') . wpas_get_offset_html5();
?>
">
								<span class="wpas-human-date"><?php 
echo get_the_date(get_option('date_format') . ' ' . get_option('time_format'), $post->ID);
?>
</span>
								<span class="wpas-date-ago"><?php 
printf(__('%s ago', 'awesome-support'), human_time_diff(get_the_time('U', $post->ID), current_time('timestamp')));
?>
</span>
							</time>
						</div>
					</div>

					<?php 
echo WP_MEMORY_LIMIT;
?>
</td>
			</tr>
			<tr class="alt">
				<td class="row-title"><?php 
_e('WP Timezone', 'wpas');
?>
</td>
				<td>
					<?php 
$timezone = get_option('timezone_string');
if (empty($timezone)) {
    echo '<span class="wpas-alert-danger">' . __('The timezone hasn\'t been set', 'wpas') . '</span>';
} else {
    echo $timezone . ' (UTC' . wpas_get_offset_html5() . ')';
}
?>
				</td>
			</tr>
		</tbody>
	</table>
	<table class="widefat wpas-system-status-table" id="wpas-system-status-server">
		<thead>
			<tr>
				<th data-override="key" class="row-title"><?php 
_e('Server', 'wpas');
?>
</th>
				<th data-override="value"></th>
			</tr>