(string) $message, 'type' => $type); set_transient($key, $notices, self::NOTICE_TTL); } public static function render_notices() { $user_id = get_current_user_id(); if (!$user_id) { return; } $key = self::NOTICE_TRANSIENT_PREFIX . $user_id; $notices = get_transient($key); if (!is_array($notices) || empty($notices)) { return; } delete_transient($key); foreach ($notices as $notice) { $type = isset($notice['type']) ? $notice['type'] : 'info'; $message = isset($notice['message']) ? $notice['message'] : ''; printf( '
%2$s