0

I am currently trying to modify the Buddypress rest api, specifically the notification endpoint and trying to add the notification description to it.

I have tried using the following functions and filters but both return null.

1)

if ( !function_exists( 'bp_get_the_notification_description' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'buddypress/bp-notifications/bp-notifications-template.php'; 
}
$ns = bp_notifications_get_notification($notification->id);
$description = apply_filters( 'bp_get_the_notification_description', $description, $ns );

2)

if ( !function_exists( 'bp_notifications_get_notifications_for_user' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'buddypress/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 ) );

3)

if ( !function_exists( 'bp_get_the_notification_description' ) ) { 
require_once ABSPATH . PLUGINDIR . 'buddypress/bp-notifications/bp-notifications-template.php'; 
}
$description = bp_get_the_notification_description();

Where could I be going wrong ? The file I am trying to edit is

\plugins\BP-REST-master\includes\bp-notifications\classes\class-bp-rest-notifications-endpoint.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.