BP_Notification_Export::bp_get_the_notification_description( $notification )
Get full-text description for a specific notification.
Description
Parameters
- $notification
-
(Required)
Return
(mixed|void)
Source
File: bp-core/gdpr/class-bp-notification-export.php
function bp_get_the_notification_description( $notification ) {
$bp = buddypress();
// Callback function exists.
if ( isset( $bp->{$notification->component_name}->notification_callback ) && is_callable( $bp->{$notification->component_name}->notification_callback ) ) {
$description = call_user_func( $bp->{$notification->component_name}->notification_callback,
$notification->component_action,
$notification->item_id,
$notification->secondary_item_id,
1,
'string',
$notification->id );
// @deprecated format_notification_function - 1.5
} elseif ( isset( $bp->{$notification->component_name}->format_notification_function ) && function_exists( $bp->{$notification->component_name}->format_notification_function ) ) {
$description = call_user_func( $bp->{$notification->component_name}->format_notification_function,
$notification->component_action,
$notification->item_id,
$notification->secondary_item_id,
1 );
// Allow non BuddyPress components to hook in.
} else {
/** This filter is documented in bp-notifications/bp-notifications-functions.php */
$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 ) );
}
/**
* Filters the full-text description for a specific notification.
*
* @since BuddyPress 1.9.0
* @since BuddyPress 2.3.0 Added the `$notification` parameter.
*
* @param string $description Full-text description for a specific notification.
* @param object $notification Notification object.
*/
return apply_filters( 'bp_get_the_notification_description', $description, $notification );
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.