Fires near the end of an activity comment posting, before the returning of the comment ID.


do_action( 'bp_activity_comment_posted', (int) $comment_id, (array) $r, (int) $activity ); 

Sends a notification to the user @see bp_activity_new_comment_notification_helper().

Parameters (3)

0. $comment_id (int)
ID of the newly posted activity comment.
1. $r (array)
Array of parsed comment arguments.
2. $activity (int)
ID of the activity item being commented on.


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

Defined (1)

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

  1. do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity );