PluginProbe
YayMail – WooCommerce Email Customizer / 3.2.2
YayMail – WooCommerce Email Customizer v3.2.2
4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 All 55 releases
yaymail / includes / MailBuilder / YaymailElement.php

YaymailElement.php in YayMail – WooCommerce Email Customizer 3.2.2, at includes/MailBuilder/YaymailElement.php

320 lines 12.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMail\MailBuilder;
4
5 defined( 'ABSPATH' ) || exit;
6 /**
7 * Settings Page
8 */
9 class YaymailElement {
10 protected static $instance = null;
11 public static function getInstance() {
12 if ( null == self::$instance ) {
13 self::$instance = new self();
14 self::$instance->doHooks();
15 }
16
17 return self::$instance;
18 }
19
20 private function doHooks() {
21 // BASIC
22 add_action( 'YaymailLogo', array( $this, 'yaymail_logo' ), 100, 6 );
23 add_action( 'YaymailImages', array( $this, 'yaymail_images' ), 100, 6 );
24 add_action( 'YaymailElementText', array( $this, 'yaymail_element_text' ), 100, 6 );
25 add_action( 'YaymailButton', array( $this, 'yaymail_button' ), 100, 6 );
26 add_action( 'YaymailTitle', array( $this, 'yaymail_title' ), 100, 6 );
27 add_action( 'YaymailSocialIcon', array( $this, 'yaymail_social_icon' ), 100, 6 );
28 add_action( 'YaymailVideo', array( $this, 'yaymail_video' ), 100, 6 );
29 add_action( 'YaymailHTMLCode', array( $this, 'yaymail_html_code' ), 100, 6 );
30 add_action( 'YaymailImageList', array( $this, 'yaymail_image_list' ), 100, 6 );
31 add_action( 'YaymailImageBox', array( $this, 'yaymail_image_box' ), 100, 6 );
32 add_action( 'YaymailTextList', array( $this, 'yaymail_text_list' ), 100, 6 );
33 // GENERAL
34 add_action( 'YaymailSpace', array( $this, 'yaymail_space' ), 100, 6 );
35 add_action( 'YaymailDivider', array( $this, 'yaymail_divider' ), 100, 6 );
36 add_action( 'YaymailOneColumn', array( $this, 'yaymail_one_column' ), 100, 6 );
37 add_action( 'YaymailTwoColumns', array( $this, 'yaymail_two_column' ), 100, 6 );
38 add_action( 'YaymailThreeColumns', array( $this, 'yaymail_three_column' ), 100, 6 );
39 add_action( 'YaymailFourColumns', array( $this, 'yaymail_four_column' ), 100, 6 );
40 // WOOCOMMERCE
41 add_action( 'YaymailShippingAddress', array( $this, 'yaymail_shipping_address' ), 100, 6 );
42 add_action( 'YaymailBillingAddress', array( $this, 'yaymail_billing_address' ), 100, 6 );
43 add_action( 'YaymailOrderItem', array( $this, 'yaymail_order_item' ), 100, 6 );
44 add_action( 'YaymailOrderItemDownload', array( $this, 'yaymail_order_item_download' ), 100, 6 );
45 add_action( 'YaymailHook', array( $this, 'yaymail_hook' ), 100, 6 );
46
47 }
48
49 public function yaymail_logo( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
50 ob_start();
51 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Logo.php';
52 $html = ob_get_contents();
53 ob_end_clean();
54 $html = do_shortcode( $html );
55 // Replace shortcode cannot do_shortcode
56 $reg = '/\[yaymail.*?\]/m';
57 $html = preg_replace( $reg, '', $html );
58 echo wp_kses_post( $html );
59 }
60
61 public function yaymail_images( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
62 ob_start();
63 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Images.php';
64 $html = ob_get_contents();
65 ob_end_clean();
66 $html = do_shortcode( $html );
67 // Replace shortcode cannot do_shortcode
68 $reg = '/\[yaymail.*?\]/m';
69 $html = preg_replace( $reg, '', $html );
70 echo wp_kses_post( $html );
71 }
72
73 public function yaymail_element_text( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
74 ob_start();
75 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ElementText.php';
76 $html = ob_get_contents();
77 ob_end_clean();
78 $html = do_shortcode( $html );
79 // Replace shortcode cannot do_shortcode
80 $reg = '/\[yaymail.*?\]/m';
81 $html = preg_replace( $reg, '', $html );
82 $allowed_html_tags = wp_kses_allowed_html( 'post' );
83 $allowed_html_tags['style'] = array();
84 echo wp_kses( $html, $allowed_html_tags );
85 }
86
87 public function yaymail_button( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
88 ob_start();
89 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Button.php';
90 $html = ob_get_contents();
91 ob_end_clean();
92 $html = do_shortcode( $html );
93 // Replace shortcode cannot do_shortcode
94 $reg = '/\[yaymail.*?\]/m';
95 $html = preg_replace( $reg, '', $html );
96 echo wp_kses_post( $html );
97 }
98 public function yaymail_title( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
99 ob_start();
100 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Title.php';
101 $html = ob_get_contents();
102 ob_end_clean();
103 $html = do_shortcode( $html );
104 // Replace shortcode cannot do_shortcode
105 $reg = '/\[yaymail.*?\]/m';
106 $html = preg_replace( $reg, '', $html );
107 echo wp_kses_post( $html );
108 }
109
110 public function yaymail_social_icon( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
111 ob_start();
112 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/SocialIcon.php';
113 $html = ob_get_contents();
114 ob_end_clean();
115 $html = do_shortcode( $html );
116 // Replace shortcode cannot do_shortcode
117 $reg = '/\[yaymail.*?\]/m';
118 $html = preg_replace( $reg, '', $html );
119 echo wp_kses_post( $html );
120 }
121
122 public function yaymail_video( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
123 ob_start();
124 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Video.php';
125 $html = ob_get_contents();
126 ob_end_clean();
127 $html = do_shortcode( $html );
128 // Replace shortcode cannot do_shortcode
129 $reg = '/\[yaymail.*?\]/m';
130 $html = preg_replace( $reg, '', $html );
131 echo wp_kses_post( $html );
132 }
133
134 public function yaymail_shipping_address( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
135 ob_start();
136 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ShippingAddress.php';
137 $html = ob_get_contents();
138 ob_end_clean();
139 $html = do_shortcode( $html );
140 // Replace shortcode cannot do_shortcode
141 $reg = '/\[yaymail.*?\]/m';
142 $html = preg_replace( $reg, '', $html );
143 echo wp_kses_post( $html );
144 }
145
146 public function yaymail_billing_address( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
147 ob_start();
148 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/BillingAddress.php';
149 $html = ob_get_contents();
150 ob_end_clean();
151 $html = do_shortcode( $html );
152 // Replace shortcode cannot do_shortcode
153 $reg = '/\[yaymail.*?\]/m';
154 $html = preg_replace( $reg, '', $html );
155 echo wp_kses_post( $html );
156 }
157
158 public function yaymail_order_item( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
159 ob_start();
160 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OrderItem.php';
161 $html = ob_get_contents();
162 ob_end_clean();
163 $html = do_shortcode( $html );
164 // Replace shortcode cannot do_shortcode
165 $reg = '/\[yaymail.*?\]/m';
166 $html = preg_replace( $reg, '', $html );
167 $allowed_html_tags = wp_kses_allowed_html( 'post' );
168 $allowed_html_tags['style'] = array();
169 echo wp_kses( $html, $allowed_html_tags );
170 }
171
172 public function yaymail_html_code( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
173 ob_start();
174 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/HTML.php';
175 $html = ob_get_contents();
176 ob_end_clean();
177 $html = do_shortcode( $html );
178 // Replace shortcode cannot do_shortcode
179 $reg = '/\[yaymail.*?\]/m';
180 $html = preg_replace( $reg, '', $html );
181 echo wp_kses_post( $html );
182 }
183
184 public function yaymail_image_list( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
185 ob_start();
186 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ImageList.php';
187 $html = ob_get_contents();
188 ob_end_clean();
189 $html = do_shortcode( $html );
190 // Replace shortcode cannot do_shortcode
191 $reg = '/\[yaymail.*?\]/m';
192 $html = preg_replace( $reg, '', $html );
193 echo wp_kses_post( $html );
194 }
195
196 public function yaymail_image_box( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
197 ob_start();
198 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ImageBox.php';
199 $html = ob_get_contents();
200 ob_end_clean();
201 $html = do_shortcode( $html );
202 // Replace shortcode cannot do_shortcode
203 $reg = '/\[yaymail.*?\]/m';
204 $html = preg_replace( $reg, '', $html );
205 echo wp_kses_post( $html );
206 }
207
208 public function yaymail_text_list( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
209 ob_start();
210 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/TextList.php';
211 $html = ob_get_contents();
212 ob_end_clean();
213 $html = do_shortcode( $html );
214 // Replace shortcode cannot do_shortcode
215 $reg = '/\[yaymail.*?\]/m';
216 $html = preg_replace( $reg, '', $html );
217 echo wp_kses_post( $html );
218 }
219
220 public function yaymail_order_item_download( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
221 ob_start();
222 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OrderItemDownload.php';
223 $html = ob_get_contents();
224 ob_end_clean();
225 $html = do_shortcode( $html );
226 // Replace shortcode cannot do_shortcode
227 $reg = '/\[yaymail.*?\]/m';
228 $html = preg_replace( $reg, '', $html );
229 echo wp_kses_post( $html );
230 }
231
232 public function yaymail_hook( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
233 ob_start();
234 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Hook.php';
235 $html = ob_get_contents();
236 ob_end_clean();
237 $html = do_shortcode( $html );
238 // Replace shortcode cannot do_shortcode
239 $reg = '/\[yaymail.*?\]/m';
240 $html = preg_replace( $reg, '', $html );
241 $allowed_html_tags = wp_kses_allowed_html( 'post' );
242 $allowed_html_tags['style'] = array();
243 echo wp_kses( $html, $allowed_html_tags );
244 }
245
246 public function yaymail_space( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
247 ob_start();
248 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Space.php';
249 $html = ob_get_contents();
250 ob_end_clean();
251 $html = do_shortcode( $html );
252 // Replace shortcode cannot do_shortcode
253 $reg = '/\[yaymail.*?\]/m';
254 $html = preg_replace( $reg, '', $html );
255 echo wp_kses_post( $html );
256 }
257
258 public function yaymail_divider( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
259 ob_start();
260 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Divider.php';
261 $html = ob_get_contents();
262 ob_end_clean();
263 $html = do_shortcode( $html );
264 // Replace shortcode cannot do_shortcode
265 $reg = '/\[yaymail.*?\]/m';
266 $html = preg_replace( $reg, '', $html );
267 echo wp_kses_post( $html );
268 }
269
270 public function yaymail_one_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
271 ob_start();
272 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OneColumn.php';
273 $html = ob_get_contents();
274 ob_end_clean();
275 $html = do_shortcode( $html );
276 // Replace shortcode cannot do_shortcode
277 $reg = '/\[yaymail.*?\]/m';
278 $html = preg_replace( $reg, '', $html );
279 $allowed_html_tags = wp_kses_allowed_html( 'post' );
280 $allowed_html_tags['style'] = array();
281 echo wp_kses( $html, $allowed_html_tags );
282 }
283
284 public function yaymail_two_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
285 ob_start();
286 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/TwoColumn.php';
287 $html = ob_get_contents();
288 ob_end_clean();
289 $html = do_shortcode( $html );
290 // Replace shortcode cannot do_shortcode
291 $reg = '/\[yaymail.*?\]/m';
292 $html = preg_replace( $reg, '', $html );
293 echo wp_kses_post( $html );
294 }
295
296 public function yaymail_three_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
297 ob_start();
298 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ThreeColumn.php';
299 $html = ob_get_contents();
300 ob_end_clean();
301 $html = do_shortcode( $html );
302 // Replace shortcode cannot do_shortcode
303 $reg = '/\[yaymail.*?\]/m';
304 $html = preg_replace( $reg, '', $html );
305 echo wp_kses_post( $html );
306 }
307
308 public function yaymail_four_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
309 ob_start();
310 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/FourColumn.php';
311 $html = ob_get_contents();
312 ob_end_clean();
313 $html = do_shortcode( $html );
314 // Replace shortcode cannot do_shortcode
315 $reg = '/\[yaymail.*?\]/m';
316 $html = preg_replace( $reg, '', $html );
317 echo wp_kses_post( $html );
318 }
319 }
320