Exemplo n.º 1
0
/**
 * Output answer time in human readable format
 * @param  boolean|integer $answer_id      If outside of loop, post ID can be passed.
 * @param  integer         $format         WP time format.
 * @return void
 */
function ap_answer_the_time($answer_id = false, $format = 'U')
{
    $answer_id = ap_parameter_empty($answer_id, @ap_answer_get_the_answer_id());
    printf(esc_attr__('%s Ago', 'ap'), '<a href="' . get_permalink($answer_id) . '"><time itemprop="datePublished" datetime="%s">' . ap_human_time(ap_answer_get_the_time($answer_id, $format)) . '</time></a>');
}
Exemplo n.º 2
0
/**
 * Output answer time in human readable format
 * @param  boolean|integer $answer_id      If outside of loop, post ID can be passed.
 * @param  integer         $format         WP time format.
 * @return void
 */
function ap_answer_the_time($answer_id = false, $format = 'U')
{
    $answer_id = ap_parameter_empty($answer_id, @ap_answer_get_the_answer_id());
    echo '<a href="' . get_permalink($answer_id) . '"><time itemprop="datePublished" datetime="' . ap_answer_get_the_time($answer_id, 'c') . '">' . ap_human_time(ap_answer_get_the_time($answer_id, $format)) . '</time></a>';
}
Exemplo n.º 3
0
function ap_answer_the_time($answer_id = false, $format = 'U')
{
    $answer_id = ap_parameter_empty($answer_id, @ap_answer_get_the_answer_id());
    printf(__('<time itemprop="datePublished" datetime="%s">%s Ago</time>', 'ap'), ap_answer_get_the_time(false, 'c'), ap_human_time(ap_answer_get_the_time($answer_id, $format)));
}