bp_get_activity_feed_item_title

Return the activity feed item title.

Description

(string) bp_get_activity_feed_item_title(); 

Returns (string)

$title The activity feed item title.


Usage

  1. if ( !function_exists( 'bp_get_activity_feed_item_title' ) ) { 
  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_feed_item_title(); 
  7.  

Defined (1)

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

/bp-activity/bp-activity-template.php  
  1. function bp_get_activity_feed_item_title() { 
  2. global $activities_template; 
  3.  
  4. if ( !empty( $activities_template->activity->action ) ) { 
  5. $content = $activities_template->activity->action; 
  6. } else { 
  7. $content = $activities_template->activity->content; 
  8.  
  9. $content = explode( '<span', $content ); 
  10. $title = strip_tags( ent2ncr( trim( convert_chars( $content[0] ) ) ) ); 
  11.  
  12. if ( ':' === substr( $title, -1 ) ) { 
  13. $title = substr( $title, 0, -1 ); 
  14.  
  15. if ( 'activity_update' === $activities_template->activity->type ) { 
  16. $title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " […]" ) ) ) ) ) ); 
  17.  
  18. /** 
  19. * Filters the activity feed item title. 
  20. * @since 1.0.0 
  21. * @param string $title The title for the activity feed item. 
  22. */