bp_get_activity_comment_user_id

Return the ID of the author of the activity comment currently being displayed.

Description

(int|bool) bp_get_activity_comment_user_id(); 

Returns (int|bool)

$user_id The user_id of the author of the displayed activity comment. False on failure.


Usage

  1. if ( !function_exists( 'bp_get_activity_comment_user_id' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_activity_comment_user_id(); 
  7.  

Defined (1)

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

/bp-activity/bp-activity-template.php  
  1. function bp_get_activity_comment_user_id() { 
  2. global $activities_template; 
  3.  
  4. $user_id = isset( $activities_template->activity->current_comment->user_id ) ? $activities_template->activity->current_comment->user_id : false; 
  5.  
  6. /** 
  7. * Filters the ID of the author of the activity comment currently being displayed. 
  8. * @since 1.5.0 
  9. * @param int|bool $user_id ID for the author of the comment currently being displayed. 
  10. */