PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / trunk
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress vtrunk
11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 10.3.0 10.4.0 All 60 releases
acymailing / WpInit / Message.php

Message.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress trunk, at WpInit/Message.php

44 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\WpInit;
4
5 defined('ABSPATH') || die('Restricted Access');
6
7 class Message
8 {
9 public function __construct()
10 {
11 // This is the frontend message system, don't load on the backend
12 if (defined('WP_ADMIN') && WP_ADMIN) return;
13
14 if (defined('DOING_AJAX') && DOING_AJAX) return;
15
16 // When calling acym_getFormToken() while _locale is set, it breaks the backend widget edition for some reason
17 $locale = acym_getVar('string', '_locale', '');
18 if (!empty($locale)) return;
19
20 wp_enqueue_style(
21 'acy_front_messages_css',
22 ACYM_CSS.'front/messages.min.css?v='.filemtime(ACYM_MEDIA.'css'.DS.'front'.DS.'messages.min.css'),
23 [],
24 '11.0.5'
25 );
26 wp_enqueue_script(
27 'acy_front_messages_js',
28 ACYM_JS.'front/messages.min.js?v='.filemtime(ACYM_MEDIA.'js'.DS.'front'.DS.'messages.min.js'),
29 [],
30 '11.0.5',
31 [
32 'in_footer' => false,
33 ]
34 );
35 wp_add_inline_script(
36 'acy_front_messages_js',
37 'var ACYM_AJAX_START = "'.admin_url('admin-ajax.php').'";
38 var ACYM_AJAX_PARAMS = "?action='.ACYM_COMPONENT.'_router&'.acym_noTemplate().'&nocache='.time().'";
39 var ACYM_AJAX = ACYM_AJAX_START + ACYM_AJAX_PARAMS;',
40 'before'
41 );
42 }
43 }
44