PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.63
Timetics – Appointment Booking Calendar & Scheduling v1.0.63
1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 All 64 releases
timetics / vendor / themewinter / email-notification-sdk / src / Assets / Enqueue.php

Enqueue.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.63, at vendor/themewinter/email-notification-sdk/src/Assets/Enqueue.php

61 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Ens\Assets;
4
5 use Ens\Config;
6 use Ens\Utils\Helpers;
7
8 /**
9 * Class Enqueue
10 *
11 * @package ENS
12 *
13 * @since 1.0.0
14 */
15 class Enqueue {
16
17 /**
18 * Config
19 *
20 * @var Config
21 */
22 private $identifier;
23
24 /**
25 * Initializing enqueue assets
26 *
27 * @since 1.0.0
28 *
29 * @return void
30 */
31 public function init($identifier) {
32 $this->identifier = $identifier;
33 add_action( 'admin_enqueue_scripts', [$this, 'enqueue_assets'],999 );
34 }
35
36 /**
37 * Enqueue admin scripts and pass localized data
38 *
39 * @since 1.0.0
40 *
41 * @return void
42 */
43 public function enqueue_assets() {
44 $admin_script_handler = Helpers::get_config_data( $this->identifier,'admin_script_handler' );
45 $plugin_slug = Helpers::get_config_data( $this->identifier,'plugin_slug' );
46
47 $general_prefix = Helpers::get_config_data( $this->identifier,'general_prefix' );
48
49 wp_localize_script( $admin_script_handler, $general_prefix . '_ens_data', [
50 // Must stay the 'wp_rest' action: this value is sent as the
51 // X-WP-Nonce header, and WordPress core rejects the whole request
52 // with rest_cookie_invalid_nonce if that header is anything else.
53 'nonce' => wp_create_nonce( 'wp_rest' ),
54 'api_version' => 'v1',
55 'plugin_slug' => $plugin_slug,
56 'base_url' => site_url(),
57 'triggers' => apply_filters( 'ens_'.$this->identifier.'_available_actions', [] )
58 ] );
59 }
60 }
61