WordPress.org

Ready to get started?Download WordPress

Forums

comments-likes
Filter to remove likes on deleted comments (1 post)

  1. maxemil
    Member
    Posted 3 years ago #

    I also use a filter so the comment_like table don't store "likes" on comments which are deleted...

    add_filter('deleted_comment','cl_deleted_comment');
    function cl_deleted_comment($comment_id)
    {
      global $wpdb;
      $cl_table_name = $wpdb->prefix . "comments_likes";
      if (! $wpdb->query( $wpdb->prepare("DELETE FROM $cl_table_name WHERE like_comment_ID = $comment_id;") ) ) return false;
    }

    BR\Emil

    http://wordpress.org/extend/plugins/comments-likes/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic