PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.1
Booktics – Appointment Booking Calendar for Service Businesses v1.0.1
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.1, at core/assets/admin-assets.php

81 lines 2.5 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 admin scripts and styles
6 */
7 class Admin_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'] );
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 wp_enqueue_style( 'wp-color-picker' );
25 wp_enqueue_style( 'booktics-admin-style' );
26 wp_enqueue_style( 'booktics-vendor' );
27
28 wp_enqueue_media();
29 wp_enqueue_script( 'booktics-flatpickr-scripts' );
30 wp_enqueue_script( 'booktics-packages' );
31 wp_enqueue_script( 'booktics-dashboard-scripts' );
32
33 wp_localize_script( 'booktics-packages', 'booktics', Localize::get_admin() );
34 wp_localize_script( 'booktics-packages', 'booktics_enabled_modules', booktics_get_enabled_modules() );
35 }
36
37 /**
38 * Get all scripts
39 *
40 * @return array List register scripts
41 */
42 public function get_scripts(): array {
43 $scripts = [
44 'booktics-dashboard-scripts' => [
45 'src' => booktics()->assets_url . '/build/js/dashboard.js',
46 'deps' => ['booktics-packages'],
47 'in_footer' => true,
48 ],
49 'booktics-flatpickr-scripts' => [
50 'src' => booktics()->assets_url . '/js/vendors/flatpickr.js',
51 'deps' => [],
52 'in_footer' => true,
53 ],
54 'booktics-packages' => [
55 'src' => booktics()->assets_url . '/build/js/packages.js',
56 'deps' => [],
57 'in_footer' => true,
58 ],
59 ];
60
61 return apply_filters( 'booktics_admin_assets', $scripts );
62 }
63
64 /**
65 * List of register styles
66 *
67 * @return array
68 */
69 public function get_styles(): array {
70 $styles = [
71 'booktics-admin-style' => [
72 'src' => booktics()->assets_url . '/build/css/admin.css',
73 ],
74 'booktics-vendor' => [
75 'src' => booktics()->assets_url . '/build/css/vendor.css',
76 ],
77 ];
78
79 return apply_filters( 'booktics_admin_styles', $styles );
80 }
81 }