wp_insert_comment WordPress Action Hook

The wp_insert_comment hook is called when a new comment is inserted into the database. It allows you to do something with the new comment, or perhaps even change it before it is stored.

do_action( 'wp_insert_comment', int $id, WP_Comment $comment ) #

Fires immediately after a comment is inserted into the database.


Parameters

$id

(int)The comment ID.

$comment

(WP_Comment)Comment object.


Top ↑

Source

File: wp-includes/comment.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More