bag === null) { $this->bag = get_option('mc4wp_flash_messages', []); } } // empty flash bag private function reset() { $this->bag = []; $this->dirty = true; } /** * Flash a message (shows on next pageload) * * @param string $message * @param string $type */ public function flash($message, $type = 'success') { $this->load(); $this->bag[] = [ 'text' => $message, 'type' => $type, ]; $this->dirty = true; } /** * Show queued flash messages */ public function show() { $this->load(); $allowed_html = [ 'a' => [ 'href' => [] ], 'br' => [], 'strong' => [], ]; foreach ($this->bag as $message) { printf('
%s