adminNotice = get_option('aphms_notice', array()); add_action('admin_notices', array($this, 'displayNotices')); } /** Store notice to database @$type success, error, info */ public function addNotice($msg, $type = 'success', $display_once = true, $dismissible = false) { $new_notice = array('msg' => $msg, 'type' => $type, 'display_once' => $display_once, 'dismissible' => $dismissible ); if (!in_array($new_notice, $this->adminNotice)) { $this->adminNotice[] = $new_notice; $this->updateOption(); } } public function displayNotices() { foreach ($this->adminNotice as $key => $notice) { $dismissible = $notice['dismissible'] ? ' is-dismissible' : ''; echo '
' . $notice['msg'] . '