wp_insert_comment хук-событиеWP 2.8.0

Fires immediately after a comment is inserted into the database.

Использование

add_action( 'wp_insert_comment', 'wp_kama_insert_comment_action', 10, 2 );

/**
 * Function for `wp_insert_comment` action-hook.
 * 
 * @param int        $id      The comment ID.
 * @param WP_Comment $comment Comment object.
 *
 * @return void
 */
function wp_kama_insert_comment_action( $id, $comment ){

	// action...
}
$id(int)
The comment ID.
$comment(WP_Comment)
Comment object.

Список изменений

С версии 2.8.0 Введена.

Где вызывается хук

wp_insert_comment()
wp_insert_comment
wp-includes/comment.php 2072
do_action( 'wp_insert_comment', $id, $comment );

Где используется хук в WordPress

Использование не найдено.