bp_get_the_notification_description

Get full-text description for a specific notification.

Description

(string) bp_get_the_notification_description(); 

Returns (string)


Usage

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

Defined (1)

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

/bp-notifications/bp-notifications-template.php  
  1. function bp_get_the_notification_description() { 
  2. $bp =buddypress); 
  3. $notification = $bp->notifications->query_loop->notification; 
  4.  
  5. // Callback function exists. 
  6. if ( isset( $bp->{ $notification->component_name }->notification_callback ) && is_callable( $bp->{ $notification->component_name }->notification_callback ) ) { 
  7. $description = call_user_func( $bp->{ $notification->component_name }->notification_callback, $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->id ); 
  8.  
  9. // @deprecated format_notification_function - 1.5 
  10. } elseif ( isset( $bp->{ $notification->component_name }->format_notification_function ) && function_exists( $bp->{ $notification->component_name }->format_notification_function ) ) { 
  11. $description = call_user_func( $bp->{ $notification->component_name }->format_notification_function, $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1 ); 
  12.  
  13. // Allow non BuddyPress components to hook in. 
  14. } else { 
  15.  
  16. /** This filter is documented in bp-notifications/bp-notifications-functions.php */ 
  17. $description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->component_action, $notification->component_name, $notification->id ) ); 
  18.  
  19. /** 
  20. * Filters the full-text description for a specific notification. 
  21. * @since 1.9.0 
  22. * @since 2.3.0 Added the `$notification` parameter. 
  23. * @param string $description Full-text description for a specific notification. 
  24. * @param object $notification Notification object. 
  25. */ 
  26. return apply_filters( 'bp_get_the_notification_description', $description, $notification );