Yoast_Notification_Center::store_notifications_for_user()
Stores the notifications to its respective user's storage.
Метод класса: Yoast_Notification_Center{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->store_notifications_for_user( $notifications, $user_id );
- $notifications(массив|Yoast_Notification[]) (обязательный)
- The notifications to store.
- $user_id(int) (обязательный)
- The ID of the user for which to store the notifications.
Код Yoast_Notification_Center::store_notifications_for_user() Yoast Notification Center::store notifications for user Yoast 22.4
private function store_notifications_for_user( $notifications, $user_id ) { $notifications_as_arrays = array_map( [ $this, 'notification_to_array' ], $notifications ); update_user_option( $user_id, self::STORAGE_KEY, $notifications_as_arrays ); }