BP_REST_Notifications_Endpoint::can_see( int $notification_id )

Can this user see the notification?


Description Description


Parameters Parameters

$notification_id

(Required) Notification ID.


Top ↑

Return Return

(bool)


Top ↑

Source Source

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

	protected function can_see( $notification_id = 0 ) {

		// Check notification access.
		if ( ! empty( $notification_id ) && (bool) BP_Notifications_Notification::check_access( bp_loggedin_user_id(), $notification_id ) ) {
			return true;
		}

		// Moderators as well.
		if ( bp_current_user_can( 'bp_moderate' ) ) {
			return true;
		}

		return false;
	}

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.