Пример #1
0
        $comment_html = str_replace('{avatar_url}', esc_url(Discourse::avatar($post->avatar_template, 64)), $comment_html);
        $comment_html = str_replace('{user_url}', esc_url(Discourse::homepage($options['url'], $post)), $comment_html);
        $comment_html = str_replace('{username}', esc_html($post->username), $comment_html);
        $comment_html = str_replace('{fullname}', esc_html($post->name), $comment_html);
        $comment_html = str_replace('{comment_body}', wp_kses_post($post->cooked), $comment_html);
        // emoticons don't have absolute urls
        $comment_html = str_replace('{comment_created_at}', mysql2date(get_option('date_format'), $post->created_at), $comment_html);
        $comments_html .= $comment_html;
    }
    foreach ($discourse_info->participants as &$participant) {
        $participant_html = wp_kses_post(Discourse::participant_html());
        $participant_html = str_replace('{discourse_url}', esc_url($options['url']), $participant_html);
        $participant_html = str_replace('{discourse_url_name}', esc_html($discourse_url_name), $participant_html);
        $participant_html = str_replace('{topic_url}', esc_url($permalink), $participant_html);
        $participant_html = str_replace('{avatar_url}', esc_url(Discourse::avatar($participant->avatar_template, 64)), $participant_html);
        $participant_html = str_replace('{user_url}', esc_url(Discourse::homepage($options['url'], $participant)), $participant_html);
        $participant_html = str_replace('{username}', esc_html($participant->username), $participant_html);
        $participant_html = str_replace('{fullname}', esc_html($participant->name), $participant_html);
        $participants_html .= $participant_html;
    }
    $discourse_html = wp_kses_post(Discourse::replies_html());
    $discourse_html = str_replace('{more_replies}', esc_html($more_replies), $discourse_html);
} else {
    $discourse_html = wp_kses_post(Discourse::no_replies_html());
}
$discourse_html = str_replace('{discourse_url}', esc_url($options['url']), $discourse_html);
$discourse_html = str_replace('{discourse_url_name}', esc_html($discourse_url_name), $discourse_html);
$discourse_html = str_replace('{topic_url}', esc_url($permalink), $discourse_html);
$discourse_html = str_replace('{comments}', wp_kses_post($comments_html), $discourse_html);
$discourse_html = str_replace('{participants}', wp_kses_post($participants_html), $discourse_html);
echo $discourse_html;