Extension:Comments/Hooks/Comment::add
Appearance
(Redirected from Manual:Hooks/Comment::add)
For more information about attaching hooks, see Manual:Hooks.
For examples of other extensions using this hook, see Category:Comment::add extensions.
The Comment::add hook is called after a new comment has been added to the database, right before the Comment::add method returns a value. The hook provides access to the Comment object ($comment), the ID of the recently added comment ($commentId) and the ID of the page which contains the <code<comments /> tag ($commentPageId).
As of Q3/2025 the only extension using this hook is LinkFilter: when a new comment is added to a Link: page, the hook subscriber increments the link_comment_count field in the link table by one.