BP_Core_Notification::check_access( int $user_id, int $notification_id )

Check the access for a user.


Description Description


Parameters Parameters

$user_id

(Required) ID to check access for.

$notification_id

(Required) Notification ID to check for.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: bp-core/classes/class-bp-core-notification.php

	public static function check_access( $user_id, $notification_id ) {
		global $wpdb;

		$bp = buddypress();

		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
	}

Top ↑

User Contributed Notes User Contributed Notes

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