edit_comment

Fires immediately after a comment is updated in the database.

Description

do_action( 'edit_comment', (int) $comment_id, (array) $data ); 

The hook also fires immediately before comment status transition hooks are fired.

Parameters (2)

0. $comment_id (int)
The comment id.
1. $data (array)
Comment data.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'edit_comment', $comment_id, $data ); 
The following example is for adding a hook callback.
  1. // define the edit_comment callback 
  2. function action_edit_comment( $comment_id, $data ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'edit_comment', 'action_edit_comment', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'edit_comment', 'action_edit_comment', 10, 2 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/comment.php  
  1. do_action( 'edit_comment', $comment_ID, $data );