Function Reference: geodir_comment_delete_comment

Summary

Delete review details when deleting comment.

Global Values

$wpdb
(object) (required) WordPress Database object.

Default: None

Package

GeoDirectory

Parameters

$comment_id
(int) (required) The comment ID.

Default: None

Change Log

Since: 1.0.0

Source File

geodir_comment_delete_comment() is located in geodirectory-functions/comments_functions.php [Line: 380]

Source Code

function geodir_comment_delete_comment($comment_id)
{
    global $wpdb;

    $review_info = geodir_get_review($comment_id);
    if ($review_info) {
        geodir_update_postrating($review_info->post_id);
    }

    $wpdb->query(
        $wpdb->prepare(
            "DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d",
            array($comment_id)
        )
    );

}