wpDiscuz 7 API Documentation

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

wpdiscuz_after_comment_post

This hook can be used for doing some action after adding comments.

Changelog

since 7.0.0 version

Parameters

1. $newComment (type: WP_Comment object) – the object of newly added comment
2. $currentUser (type: WP_User object) – the user object that is logged in at the current time

Usage

add_action("wpdiscuz_after_comment_post", function ($newComment, $currentUser) {
    $newCommentId = $newComment->comment_ID;
}, 10, 2);

Was this article helpful to you? Yes 1 No