Title: joshuask8dev's Replies | WordPress.org

---

# joshuask8dev

  [  ](https://wordpress.org/support/users/joshuask8dev/)

 *   [Profile](https://wordpress.org/support/users/joshuask8dev/)
 *   [Topics Started](https://wordpress.org/support/users/joshuask8dev/topics/)
 *   [Replies Created](https://wordpress.org/support/users/joshuask8dev/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/joshuask8dev/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/joshuask8dev/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/joshuask8dev/engagements/)
 *   [Favorites](https://wordpress.org/support/users/joshuask8dev/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Using Hooks With Comment Query](https://wordpress.org/support/topic/using-hooks-with-comment-query/)
 *  Thread Starter [joshuask8dev](https://wordpress.org/support/users/joshuask8dev/)
 * (@joshuask8dev)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/using-hooks-with-comment-query/#post-12394505)
 * So I have this for a function to filter out comments by the current user that
   is logged in ID and per page:
 *     ```
       function wps_get_comment_list_by_user($clauses) {
   
       global $user_ID, $wpdb;
       $clauses['join'] = ", wp_posts";
   
       $where = ‘WHERE user_id = ‘ . get_current_user_id() . ‘ AND comment_approved <> “trash” AND comment_post_ID = ‘ . get_the_id();
   
       return $clauses;
       };
   
       add_filter('pre_get_comments', 'wps_get_comment_list_by_user');
       ```
   
 * Are we close to getting it so that comments on each page only show to the user
   logged in that they posted themselves?

Viewing 1 replies (of 1 total)