Server IP : 192.64.112.168 / Your IP : 3.142.198.250 Web Server : Apache System : Linux nc-ph-2300-85.bluforrest.com 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64 User : expressoneac ( 1128) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/expressoneac/www/wp-content/plugins/mailchimp-for-wp/includes/admin/ |
Upload File : |
<?php /** * Class MC4WP_Admin_Messages * * @ignore * @since 3.0 */ class MC4WP_Admin_Messages { /** * @var array */ protected $bag; /** * @var bool */ protected $dirty = false; /** * Add hooks */ public function add_hooks() { add_action('admin_notices', array( $this, 'show' )); register_shutdown_function(array( $this, 'save' )); } private function load() { if (is_null($this->bag)) { $this->bag = get_option('mc4wp_flash_messages', array()); } } // empty flash bag private function reset() { $this->bag = array(); $this->dirty = true; } /** * Flash a message (shows on next pageload) * * @param $message * @param string $type */ public function flash($message, $type = 'success') { $this->load(); $this->bag[] = array( 'text' => $message, 'type' => $type, ); $this->dirty = true; } /** * Show queued flash messages */ public function show() { $this->load(); foreach ($this->bag as $message) { echo sprintf('<div class="notice notice-%s is-dismissible"><p>%s</p></div>', $message['type'], $message['text']); } $this->reset(); } /** * Save queued messages * * @hooked `shutdown` */ public function save() { if ($this->dirty) { update_option('mc4wp_flash_messages', $this->bag, false); } } }