PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 2.13
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v2.13
5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 3.0.70 3.0.71 3.0.72 All 35 releases
double-opt-in / core / Messages.class.php

Messages.class.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 2.13, at core/Messages.class.php

92 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace forge12\contactform7\CF7DoubleOptIn {
4 if(!defined('ABSPATH')){
5 exit;
6 }
7 /**
8 * Class Messages
9 * @package forge12\contactform7\CF7DoubleOptIn
10 */
11 class Messages
12 {
13 /**
14 * @var Messages|null
15 */
16 private static $instance;
17
18 /**
19 * @var array
20 */
21 private $messages = [];
22
23 /**
24 * @return Messages|null
25 */
26 public static function getInstance()
27 {
28 if (null === self::$instance) {
29 self::$instance = new Messages();
30 }
31
32 return self::$instance;
33 }
34
35 private function __clone()
36 {
37
38 }
39
40 public function __wakeup()
41 {
42
43 }
44
45 private function __construct()
46 {
47 }
48
49 /**
50 * getAll function.
51 *
52 * @access public
53 * @return string
54 */
55 public function getAll()
56 {
57 return implode("\n", $this->messages);
58 }
59
60 /**
61 * add function.
62 *
63 * @access public
64 * @param mixed $message
65 * @param mixed $type
66 * @return void
67 */
68 public function add($message, $type)
69 {
70 if ($type === 'error') {
71 $type = 'alert-danger';
72
73 } elseif ($type === 'success') {
74 $type = 'alert-success';
75
76 } elseif ($type === 'info') {
77 $type = 'alert-info';
78
79 } elseif ($type === 'warning') {
80 $type = 'alert-warning';
81
82 } elseif ($type === 'offer') {
83 $type = 'alert-offer';
84
85 } elseif ($type === 'critical') {
86 $type = 'alert-critical';
87 }
88
89 $this->messages[] = '<div class="box ' . \esc_attr($type) . '" role="alert">' . esc_html($message) . '</div>';
90 }
91 }
92 }