_id = $id; $this->_severity = $severity; $this->_messageHTML = $messageHTML; $this->_category = $category; $this->_buttons = $buttons; } public function display_notice() { $severityClass = 'notice-info'; if ($this->_severity == self::SEVERITY_CRITICAL) { $severityClass = 'notice-error'; } else if ($this->_severity == self::SEVERITY_WARNING) { $severityClass = 'notice-warning'; } if (!preg_match('/^

/', $this->_messageHTML)) { $this->_messageHTML = '

' . $this->_messageHTML . '

'; } echo '
' . $this->_messageHTML . '

' . implode('', array_map(function($b) { return sprintf('%2$s ', esc_url($b['href']), esc_html($b['label'])); }, $this->_buttons)) . sprintf('' . __('Dismiss', 'wordfence') . '', esc_attr($this->_id)) . '

' . '
'; } }