BP_Notifications_Notification::get_all_for_user( int $user_id, string $status = 'is_new' )

Fetch all the notifications in the database for a specific user.


Parameters Parameters

$user_id

(int) (Required) ID of the user whose notifications are being fetched.

$status

(string) (Optional) Status of notifications to fetch. 'is_new' to get only unread items, 'all' to get all.

Default value: 'is_new'


Top ↑

Return Return

(array) Associative array of notification items.


Source Source

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

	public static function get_all_for_user( $user_id, $status = 'is_new' ) {
		return self::get( array(
			'user_id' => $user_id,
			'is_new'  => 'is_new' === $status,
		) );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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