Yoast\WP\SEO\Helpers

Notification_Helper::get_alertspublicYoast 1.0

Parses all the notifications to an array with just id, message, nonce, type and dismissed.

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

Хуков нет.

Возвращает

Массив<Строку,. string|bool>

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

$Notification_Helper = new Notification_Helper();
$Notification_Helper->get_alerts(): array;

Код Notification_Helper::get_alerts() Yoast 27.6

public function get_alerts(): array {
	$all_notifications = $this->get_sorted_notifications();

	return \array_map(
		function ( $notification ) {
			return [
				'id'           => $notification->get_id(),
				'message'      => $notification->get_message(),
				'nonce'        => $notification->get_nonce(),
				'type'         => $notification->get_type(),
				'dismissed'    => $this->is_notification_dismissed( $notification ),
				'resolveNonce' => $notification->get_resolve_nonce(),
			];
		},
		$all_notifications,
	);
}