Yoast_Notifications::collect_notifications
Collect the notifications and group them together.
Метод класса: Yoast_Notifications{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = Yoast_Notifications::collect_notifications();
Код Yoast_Notifications::collect_notifications() Yoast Notifications::collect notifications Yoast 27.8
public static function collect_notifications() {
$notification_center = Yoast_Notification_Center::get();
$notifications = $notification_center->get_sorted_notifications();
self::$notification_count = count( $notifications );
self::$errors = array_filter( $notifications, [ self::class, 'filter_error_notifications' ] );
self::$dismissed_errors = array_filter( self::$errors, [ self::class, 'filter_dismissed_notifications' ] );
self::$active_errors = array_diff( self::$errors, self::$dismissed_errors );
self::$warnings = array_filter( $notifications, [ self::class, 'filter_warning_notifications' ] );
self::$dismissed_warnings = array_filter( self::$warnings, [ self::class, 'filter_dismissed_notifications' ] );
self::$active_warnings = array_diff( self::$warnings, self::$dismissed_warnings );
}