PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.11
Booktics – Appointment Booking Calendar for Service Businesses v1.0.11
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 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.2 1.0.3 All 31 releases
booktics / core / assets / feedback-modal-assets.php

feedback-modal-assets.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.11, at core/assets/feedback-modal-assets.php

69 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Booktics\Assets;
3
4 /**
5 * Manage all common scripts and styles
6 */
7 class Feedback_Modal_Assets extends Base_Assets {
8 /**
9 * Register single service
10 *
11 * @return void
12 */
13 public function register() {
14 add_action( 'admin_enqueue_scripts', [$this, 'register_styles_scripts'], 9 );
15 add_action( 'admin_enqueue_scripts', [$this, 'enqueue'] );
16 }
17
18 /**
19 * Enqueue scripts and styles
20 *
21 * @return void
22 */
23 public function enqueue() {
24 $screen = get_current_screen();
25 if ( $screen->base !== 'plugins') {
26 return;
27 }
28 wp_enqueue_style( 'booktics-feedback-modal' );
29 wp_enqueue_script( 'booktics-feedback-modal' );
30
31 wp_localize_script('booktics-feedback-modal','booktics_feedback', [ 'site_url' => site_url(), 'admin_email' => get_option('admin_email') ]);
32 }
33
34 /**
35 * Get all scripts
36 *
37 * @return array List register scripts
38 */
39 public function get_scripts(): array {
40 $scripts = [
41 'booktics-feedback-modal' => [
42 'src' => booktics()->assets_url . '/build/js/feedback-modal.js',
43 'deps' => [
44 'wp-i18n'
45 ],
46 'in_footer' => false,
47 ],
48 ];
49
50 return apply_filters( 'booktics_feedback_modal_assets', $scripts );
51 }
52
53 /**
54 * List of register styles
55 *
56 * @return array
57 */
58 public function get_styles(): array {
59 $styles = [
60 'booktics-feedback-modal' => [
61 'src' => booktics()->assets_url . '/build/css/feedback-modal.css',
62 ],
63 ];
64
65 return apply_filters( 'booktics_feedback_modal_styles', $styles );
66 }
67 }
68
69