wpDiscuz 7 API Documentation

  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentation
  4. Filters
  5. wpdiscuz_bubble_new_comment_ids
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

wpdiscuz_bubble_new_comment_ids

This hook can be used to filter the comments that the bubble should display.

Changelog

Since 7.0.0 version

Parameters

1. $newCommentIds (type: array) – the ID of the new comment
2. $postId (type: int) – the parent post-id of the comments
3. $currentUser (type: WP_User object) – the object of the current user

Usage

add_filter("wpdiscuz_bubble_new_comment_ids", function ($newCommentIds, $postId, $currentUser) {
    if ($postId == 57) {
        $newCommentIds = array_slice($newCommentIds, 0, 5);
    }
    return $newCommentIds;
}, 10, 3);

Was this article helpful to you? Yes No