bp_activity_get_comment_count

Return the comment count of an activity item.

Description

(int) bp_activity_get_comment_count( (null) $deprecated = null ); 

Returns (int)

$count The activity comment count.

Parameters (1)

0. $deprecated — Optional. (null) => null
The deprecated.

Usage

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

Defined (1)

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

/bp-activity/bp-activity-template.php  
  1. function bp_activity_get_comment_count( $deprecated = null ) { 
  2. global $activities_template; 
  3.  
  4. // Deprecated notice about $args. 
  5. if ( ! empty( $deprecated ) ) { 
  6. _deprecated_argument( __FUNCTION__, '1.2', sprintf( __( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', buddypress ), __FUNCTION__, __FILE__ ) ); 
  7.  
  8. // Get the count using the purpose-built recursive function. 
  9. $count = ! empty( $activities_template->activity->children ) 
  10. ? bp_activity_recurse_comment_count( $activities_template->activity ) 
  11. : 0; 
  12.  
  13. /** 
  14. * Filters the activity comment count. 
  15. * @since 1.2.0 
  16. * @param int $count The activity comment count. 
  17. */