PluginProbe
EmailKit – Email Customizer for WooCommerce & WP / 1.2.0
EmailKit – Email Customizer for WooCommerce & WP v1.2.0
1.6.9 1.6.8 1.6.7 trunk 1.0.0 1.2.0 1.4.0 1.4.5 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6
emailkit / includes / Admin / EmailKitEditor / EmailKitEditorInit.php

EmailKitEditorInit.php in EmailKit – Email Customizer for WooCommerce & WP 1.2.0, at includes/Admin/EmailKitEditor/EmailKitEditorInit.php

59 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace EmailKit\Admin\EmailKitEditor;
3
4 use EmailKit\Admin\MetaField\StyleLoad;
5
6 defined('ABSPATH') || exit('No direct script access allowed!');
7
8 /**
9 * EmailKitEditorInit
10 *
11 * @since 1.0.0
12 */
13
14 class EmailKitEditorInit
15 {
16
17 public function __construct()
18 {
19 if(!current_user_can( 'manage_options' )){
20 return;
21 }
22 $post_id = isset($_GET['post']) ? sanitize_text_field(wp_unslash($_GET['post'])) : ''; //phpcs:ignore WordPress.Security.NonceVerification -- Nonce can't be added in CPT edit page URL
23 $action = isset($_GET['action']) ? sanitize_text_field(wp_unslash($_GET['action'])) : ''; //phpcs:ignore WordPress.Security.NonceVerification -- Nonce can't be added in CPT edit page URL
24 $post_type = get_post_type($post_id);
25
26 if (empty($post_id) || $action != 'emailkit-builder' || $post_type != 'emailkit') {
27 return;
28 }
29
30 new StyleLoad();
31 add_action('wp_loaded', [$this, 'add_editor_template']);
32 }
33
34 public function add_editor_template()
35 {
36 ?>
37 <!DOCTYPE html>
38 <html>
39 <head>
40 <?php wp_head(); ?>
41 <meta charSet="utf-8" />
42 <meta name="viewport" content="width=device-width" />
43 <meta name="next-head-count" content="2" />
44 </head>
45
46 <body class="<?php body_class(['post-'.get_the_ID()]); ?>">
47
48 <?php
49 require_once EMAILKIT_PATH . '/build/server/pages/editor.php';
50 wp_footer();
51 ?>
52
53 </body>
54 </html>
55 <?php
56 exit();
57 }
58 }
59