Yoast_Notification_Center::split_on_user_id()privateYoast 1.0

Splits the notifications on user ID.

In other terms, it returns an associative array, mapping user ID to a list of notifications for this user.

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

Хуков нет.

Возвращает

Массив. The notifications, split on user ID.

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

// private - только в коде основоного (родительского) класса
$result = $this->split_on_user_id( $notifications );
$notifications(массив|Yoast_Notification[]) (обязательный)
The notifications to split.

Код Yoast_Notification_Center::split_on_user_id() Yoast 22.4

private function split_on_user_id( $notifications ) {
	$split_notifications = [];
	foreach ( $notifications as $notification ) {
		$split_notifications[ $notification->get_user_id() ][] = $notification;
	}
	return $split_notifications;
}