Function Reference: best_of_show_review_in_excerpt

Summary

This function has not been documented yet.

Source File

best_of_show_review_in_excerpt() is located in geodirectory-widgets/geodirectory_bestof_widget.php [Line: 767]

Source Code

function best_of_show_review_in_excerpt($excerpt)
{
    global $wpdb, $post;
    $review_table = GEODIR_REVIEW_TABLE;
    $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
    $comments = $wpdb->get_results($request);

    if ($comments) {
        foreach ($comments as $comment) {
            // Set the extra comment info needed.
            $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
            $comment_content = $comment_extra->comment_content;
            $excerpt = strip_tags($comment_content);
        }
    }
    return $excerpt;
}