PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.2
Booktics – Appointment Booking Calendar for Service Businesses v1.0.2
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 / admin-assets.php

admin-assets.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.2, at core/assets/admin-assets.php

90 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Booktics\Assets;
4
5 /**
6 * Manage all admin scripts and styles
7 */
8 class Admin_Assets extends Base_Assets {
9 /**
10 * Register single service
11 *
12 * @return void
13 */
14 public function register() {
15 add_action( 'admin_enqueue_scripts', [
16 $this,
17 'register_styles_scripts'
18 ] );
19 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
20 }
21
22 /**
23 * Enqueue scripts and styles
24 *
25 * @return void
26 */
27 public function enqueue() {
28 wp_enqueue_style( 'wp-color-picker' );
29 wp_enqueue_style( 'booktics-admin-style' );
30 wp_enqueue_style( 'booktics-vendor' );
31
32 wp_enqueue_media();
33 wp_enqueue_script( 'booktics-flatpickr-scripts' );
34 wp_enqueue_script( 'booktics-packages' );
35 wp_enqueue_script( 'booktics-dashboard-scripts' );
36
37 wp_localize_script( 'booktics-packages', 'booktics', Localize::get_admin() );
38 wp_localize_script( 'booktics-packages', 'booktics_enabled_modules', booktics_get_enabled_modules() );
39 }
40
41 /**
42 * Get all scripts
43 *
44 * @return array List register scripts
45 */
46 public function get_scripts(): array {
47 $scripts = [
48 'booktics-dashboard-scripts' => [
49 'src' => booktics()->assets_url . '/build/js/dashboard.js',
50 'deps' => [ 'booktics-packages' ],
51 'in_footer' => true,
52 ],
53 'booktics-flatpickr-scripts' => [
54 'src' => booktics()->assets_url . '/js/vendors/flatpickr.js',
55 'deps' => [],
56 'in_footer' => true,
57 ],
58 'booktics-packages' => [
59 'src' => booktics()->assets_url . '/build/js/packages.js',
60 'deps' => [
61 'wp-api-fetch',
62 'wp-components',
63 'wp-compose',
64 'wp-i18n'
65 ],
66 'in_footer' => true,
67 ],
68 ];
69
70 return apply_filters( 'booktics_admin_assets', $scripts );
71 }
72
73 /**
74 * List of register styles
75 *
76 * @return array
77 */
78 public function get_styles(): array {
79 $styles = [
80 'booktics-admin-style' => [
81 'src' => booktics()->assets_url . '/build/css/admin.css',
82 ],
83 'booktics-vendor' => [
84 'src' => booktics()->assets_url . '/build/css/vendor.css',
85 ],
86 ];
87
88 return apply_filters( 'booktics_admin_styles', $styles );
89 }
90 }