PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.24
Booktics – Appointment Booking Calendar for Service Businesses v1.0.24
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.24, at core/assets/feedback-modal-assets.php

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