Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
if ( false === $question_id ) {
$question_id = get_the_ID();
}
$metas = array();
// If featured question.
if ( ap_is_featured_question( $question_id ) ) {
$metas['featured'] = __( 'Featured', 'anspress-question-answer' );
}
if ( is_question() ) {
$last_active = ap_get_last_active( get_question_id() );
$metas['active'] = '' . $last_active . '
';
}
echo PHP_EOL;
if ( ! is_question() ) {
$metas['history'] = '' . ap_recent_activity( $question_id, false );
}
echo PHP_EOL;
if ( ap_have_answer_selected() ) {
$metas['solved'] = '' . __( 'Solved', 'anspress-question-answer' ) . '
';
}
echo PHP_EOL;
$view_count = ap_get_post_field( 'views' );
$metas['views'] = '' . sprintf( __( '%d views', 'anspress-question-answer' ), $view_count ) . '';
/**
* Used to filter question display meta.
*
* @param array $metas
*/
$metas = apply_filters( 'ap_display_question_metas', $metas, $question_id );
$output = '';
if ( ! empty( $metas ) && is_array( $metas ) ) {
foreach ( $metas as $meta => $display ) {
$output .= "{$display}";
}
}
echo $output; // xss ok.
}