Yoast_Notification_Center::get_notifications_for_user()publicYoast 1.0

Returns the notifications for the given user.

Метод класса: Yoast_Notification_Center{}

Хуков нет.

Возвращает

Yoast_Notification[]. The notifications for the user with the given ID.

Использование

$Yoast_Notification_Center = new Yoast_Notification_Center();
$Yoast_Notification_Center->get_notifications_for_user( $user_id );
$user_id(int) (обязательный)
The id of the user to check.

Код Yoast_Notification_Center::get_notifications_for_user() Yoast 23.5

public function get_notifications_for_user( $user_id ) {
	if ( array_key_exists( $user_id, $this->notifications ) ) {
		return $this->notifications[ $user_id ];
	}
	return [];
}