BP_Core_Notification::check_access( int $user_id, int $notification_id )
Check the access for a user.
Description
Parameters
- $user_id
-
(Required) ID to check access for.
- $notification_id
-
(Required) Notification ID to check for.
Return
(string)
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 ) ); }
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.