BP_REST_Notifications_Endpoint::get_notification_object( WP_REST_Request $request )

Get notification object.


Description Description


Parameters Parameters

$request

(Required) Full details about the request.


Top ↑

Return Return

(BP_Notifications_Notification|string) A notification object|Empty string.


Top ↑

Source Source

File: bp-notifications/classes/class-bp-rest-notifications-endpoint.php

	public function get_notification_object( $request ) {
		$notification_id = is_numeric( $request ) ? $request : (int) $request['id'];

		$notification = bp_notifications_get_notification( $notification_id );

		if ( empty( $notification->id ) ) {
			return '';
		}

		return $notification;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.