Exemplo n.º 1
0
 public static function convert($post)
 {
     global $current_user;
     $result = self::get_instance()->_convert($post);
     $result->qa_tag = wp_get_object_terms($post->ID, 'qa_tag');
     $result->et_vote_up_authors = is_array($result->et_vote_up_authors) ? $result->et_vote_up_authors : array();
     $result->et_vote_down_authors = is_array($result->et_vote_down_authors) ? $result->et_vote_down_authors : array();
     $result->voted_down = in_array($current_user->ID, (array) $result->et_vote_down_authors);
     $result->voted_up = in_array($current_user->ID, (array) $result->et_vote_up_authors);
     $result->et_vote_count = get_post_meta($post->ID, 'et_vote_count', true) ? get_post_meta($post->ID, 'et_vote_count', true) : 0;
     $result->user_badge = qa_user_badge($post->post_author, false);
     $result->et_answers_count = et_count_answer($post->ID);
     $result->et_view_count = $result->et_view_count ? $result->et_view_count : 0;
     $result->et_answer_authors = is_array($result->et_answer_authors) ? $result->et_answer_authors : array();
     $result->answered = in_array($current_user->ID, (array) $result->et_answer_authors);
     $result->has_category = !empty($result->question_category);
     $result->content_filter = apply_filters('the_content', $post->post_content);
     $result->content_edit = et_the_content_edit($post->post_content);
     $result->author_name = get_the_author_meta('display_name', $post->post_author);
     $result->followed = in_array($current_user->ID, (array) $result->et_users_follow);
     $result->reported = in_array($current_user->ID, (array) get_post_meta($post->ID, 'et_users_report', true));
     return $result;
 }
Exemplo n.º 2
0
</a>
                    </div>
                    <!-- COMMENT IN COMMENT / END -->                    
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT QUESTION / END -->
    
    <!-- LABEL -->
    <section class="label-vote-wrapper">
    	<div class="container">
            <div class="row">
            	<div class="col-md-12">
                    <span><span class="number"><?php 
echo et_count_answer($question->ID);
?>
</span> <?php 
_e("Answers", ET_DOMAIN);
?>
</span>
                    <div class="select-categories-wrapper">
                        <div class="select-categories">
                            <select class="select-grey-bg" id="move_to_order">
                                <option value="<?php 
echo get_permalink($question->ID);
?>
"><?php 
_e("Vote", ET_DOMAIN);
?>
</option>