Yoast_Notification_Center::get_notifications_for_user
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 Notification Center::get notifications for user Yoast 26.5
public function get_notifications_for_user( $user_id ) {
if ( array_key_exists( $user_id, $this->notifications ) ) {
return $this->notifications[ $user_id ];
}
return [];
}