<?php /** * @package WPSEO\Admin */ /** @noinspection PhpUnusedLocalVariableInspection */ $alerts_data = Yoast_Alerts::get_template_variables(); ?> <div class="wrap yoast-alerts"> <h2><?php /* translators: %1$s expands to Yoast SEO */ printf(__('%1$s Dashboard', 'wordpress-seo'), 'Yoast SEO'); ?> </h2> <div class="yoast-container yoast-container__alert"> <?php include WPSEO_PATH . 'admin/views/partial-alerts-errors.php'; ?> </div> <div class="yoast-container yoast-container__warning"> <?php include WPSEO_PATH . 'admin/views/partial-alerts-warnings.php'; ?> </div> </div>
/** * Collect the alerts and group them together */ public static function collect_alerts() { $notification_center = Yoast_Notification_Center::get(); $notifications = $notification_center->get_sorted_notifications(); self::$notification_count = count($notifications); self::$errors = array_filter($notifications, array(__CLASS__, 'filter_error_alerts')); self::$dismissed_errors = array_filter(self::$errors, array(__CLASS__, 'filter_dismissed_alerts')); self::$active_errors = array_diff(self::$errors, self::$dismissed_errors); self::$warnings = array_filter($notifications, array(__CLASS__, 'filter_warning_alerts')); self::$dismissed_warnings = array_filter(self::$warnings, array(__CLASS__, 'filter_dismissed_alerts')); self::$active_warnings = array_diff(self::$warnings, self::$dismissed_warnings); }