PluginProbe
YayMail – WooCommerce Email Customizer / 2.1.4
YayMail – WooCommerce Email Customizer v2.1.4
4.4.6 4.4.5 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 All 57 releases
yaymail / includes / MailBuilder / YaymailElement.php

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

312 lines 11.6 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 echo wp_kses_post( $html );
83 }
84
85 public function yaymail_button( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
86 ob_start();
87 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Button.php';
88 $html = ob_get_contents();
89 ob_end_clean();
90 $html = do_shortcode( $html );
91 // Replace shortcode cannot do_shortcode
92 $reg = '/\[yaymail.*?\]/m';
93 $html = preg_replace( $reg, '', $html );
94 echo wp_kses_post( $html );
95 }
96 public function yaymail_title( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
97 ob_start();
98 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Title.php';
99 $html = ob_get_contents();
100 ob_end_clean();
101 $html = do_shortcode( $html );
102 // Replace shortcode cannot do_shortcode
103 $reg = '/\[yaymail.*?\]/m';
104 $html = preg_replace( $reg, '', $html );
105 echo wp_kses_post( $html );
106 }
107
108 public function yaymail_social_icon( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
109 ob_start();
110 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/SocialIcon.php';
111 $html = ob_get_contents();
112 ob_end_clean();
113 $html = do_shortcode( $html );
114 // Replace shortcode cannot do_shortcode
115 $reg = '/\[yaymail.*?\]/m';
116 $html = preg_replace( $reg, '', $html );
117 echo wp_kses_post( $html );
118 }
119
120 public function yaymail_video( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
121 ob_start();
122 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Video.php';
123 $html = ob_get_contents();
124 ob_end_clean();
125 $html = do_shortcode( $html );
126 // Replace shortcode cannot do_shortcode
127 $reg = '/\[yaymail.*?\]/m';
128 $html = preg_replace( $reg, '', $html );
129 echo wp_kses_post( $html );
130 }
131
132 public function yaymail_shipping_address( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
133 ob_start();
134 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ShippingAddress.php';
135 $html = ob_get_contents();
136 ob_end_clean();
137 $html = do_shortcode( $html );
138 // Replace shortcode cannot do_shortcode
139 $reg = '/\[yaymail.*?\]/m';
140 $html = preg_replace( $reg, '', $html );
141 echo wp_kses_post( $html );
142 }
143
144 public function yaymail_billing_address( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
145 ob_start();
146 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/BillingAddress.php';
147 $html = ob_get_contents();
148 ob_end_clean();
149 $html = do_shortcode( $html );
150 // Replace shortcode cannot do_shortcode
151 $reg = '/\[yaymail.*?\]/m';
152 $html = preg_replace( $reg, '', $html );
153 echo wp_kses_post( $html );
154 }
155
156 public function yaymail_order_item( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
157 ob_start();
158 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OrderItem.php';
159 $html = ob_get_contents();
160 ob_end_clean();
161 $html = do_shortcode( $html );
162 // Replace shortcode cannot do_shortcode
163 $reg = '/\[yaymail.*?\]/m';
164 $html = preg_replace( $reg, '', $html );
165 echo wp_kses_post( $html );
166 }
167
168 public function yaymail_html_code( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
169 ob_start();
170 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/HTML.php';
171 $html = ob_get_contents();
172 ob_end_clean();
173 $html = do_shortcode( $html );
174 // Replace shortcode cannot do_shortcode
175 $reg = '/\[yaymail.*?\]/m';
176 $html = preg_replace( $reg, '', $html );
177 echo wp_kses_post( $html );
178 }
179
180 public function yaymail_image_list( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
181 ob_start();
182 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ImageList.php';
183 $html = ob_get_contents();
184 ob_end_clean();
185 $html = do_shortcode( $html );
186 // Replace shortcode cannot do_shortcode
187 $reg = '/\[yaymail.*?\]/m';
188 $html = preg_replace( $reg, '', $html );
189 echo wp_kses_post( $html );
190 }
191
192 public function yaymail_image_box( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
193 ob_start();
194 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ImageBox.php';
195 $html = ob_get_contents();
196 ob_end_clean();
197 $html = do_shortcode( $html );
198 // Replace shortcode cannot do_shortcode
199 $reg = '/\[yaymail.*?\]/m';
200 $html = preg_replace( $reg, '', $html );
201 echo wp_kses_post( $html );
202 }
203
204 public function yaymail_text_list( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
205 ob_start();
206 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/TextList.php';
207 $html = ob_get_contents();
208 ob_end_clean();
209 $html = do_shortcode( $html );
210 // Replace shortcode cannot do_shortcode
211 $reg = '/\[yaymail.*?\]/m';
212 $html = preg_replace( $reg, '', $html );
213 echo wp_kses_post( $html );
214 }
215
216 public function yaymail_order_item_download( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
217 ob_start();
218 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OrderItemDownload.php';
219 $html = ob_get_contents();
220 ob_end_clean();
221 $html = do_shortcode( $html );
222 // Replace shortcode cannot do_shortcode
223 $reg = '/\[yaymail.*?\]/m';
224 $html = preg_replace( $reg, '', $html );
225 echo wp_kses_post( $html );
226 }
227
228 public function yaymail_hook( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
229 ob_start();
230 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Hook.php';
231 $html = ob_get_contents();
232 ob_end_clean();
233 $html = do_shortcode( $html );
234 // Replace shortcode cannot do_shortcode
235 $reg = '/\[yaymail.*?\]/m';
236 $html = preg_replace( $reg, '', $html );
237 echo wp_kses_post( $html );
238 }
239
240 public function yaymail_space( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
241 ob_start();
242 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Space.php';
243 $html = ob_get_contents();
244 ob_end_clean();
245 $html = do_shortcode( $html );
246 // Replace shortcode cannot do_shortcode
247 $reg = '/\[yaymail.*?\]/m';
248 $html = preg_replace( $reg, '', $html );
249 echo wp_kses_post( $html );
250 }
251
252 public function yaymail_divider( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
253 ob_start();
254 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/Divider.php';
255 $html = ob_get_contents();
256 ob_end_clean();
257 $html = do_shortcode( $html );
258 // Replace shortcode cannot do_shortcode
259 $reg = '/\[yaymail.*?\]/m';
260 $html = preg_replace( $reg, '', $html );
261 echo wp_kses_post( $html );
262 }
263
264 public function yaymail_one_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
265 ob_start();
266 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/OneColumn.php';
267 $html = ob_get_contents();
268 ob_end_clean();
269 $html = do_shortcode( $html );
270 // Replace shortcode cannot do_shortcode
271 $reg = '/\[yaymail.*?\]/m';
272 $html = preg_replace( $reg, '', $html );
273 echo wp_kses_post( $html );
274 }
275
276 public function yaymail_two_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
277 ob_start();
278 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/TwoColumn.php';
279 $html = ob_get_contents();
280 ob_end_clean();
281 $html = do_shortcode( $html );
282 // Replace shortcode cannot do_shortcode
283 $reg = '/\[yaymail.*?\]/m';
284 $html = preg_replace( $reg, '', $html );
285 echo wp_kses_post( $html );
286 }
287
288 public function yaymail_three_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
289 ob_start();
290 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/ThreeColumn.php';
291 $html = ob_get_contents();
292 ob_end_clean();
293 $html = do_shortcode( $html );
294 // Replace shortcode cannot do_shortcode
295 $reg = '/\[yaymail.*?\]/m';
296 $html = preg_replace( $reg, '', $html );
297 echo wp_kses_post( $html );
298 }
299
300 public function yaymail_four_column( $args, $attrs, $general_attrs, $id, $postID = '', $isInColumns = false ) {
301 ob_start();
302 include YAYMAIL_PLUGIN_PATH . 'includes/Templates/Elements/YayMail/FourColumn.php';
303 $html = ob_get_contents();
304 ob_end_clean();
305 $html = do_shortcode( $html );
306 // Replace shortcode cannot do_shortcode
307 $reg = '/\[yaymail.*?\]/m';
308 $html = preg_replace( $reg, '', $html );
309 echo wp_kses_post( $html );
310 }
311 }
312