bpln_get_the_notification_description

A copy of bp_get_the_notification_description to server our purpose of parsing notification to extract the message.

Description

bpln_get_the_notification_description( (type) $notification ); 

Parameters (1)

0. $notification (type)
The notification.

Usage

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

Defined (1)

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

/functions.php  
  1. function bpln_get_the_notification_description( $notification ) { 
  2.  
  3. $bp = buddypress(); 
  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 ); 
  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( 
  18. $notification->component_action,  
  19. $notification->item_id,  
  20. $notification->secondary_item_id,  
  21. ) ); 
  22.  
  23. /** 
  24. * Filters the full-text description for a specific notification. 
  25. * @since BuddyPress (1.9.0) 
  26. * @param string $description Full-text description for a specific notification. 
  27. */ 
  28. return apply_filters( 'bp_get_the_notification_description', $description );