PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.0
Booktics – Appointment Booking Calendar for Service Businesses v1.0.0
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 1.0.4 1.0.5 1.0.6 1.0.7 All 27 releases
booktics / core / assets / admin-assets.php

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

80 lines 2.3 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 }
35
36 /**
37 * Get all scripts
38 *
39 * @return array List register scripts
40 */
41 public function get_scripts(): array {
42 $scripts = [
43 'booktics-dashboard-scripts' => [
44 'src' => booktics()->assets_url . '/build/js/dashboard.js',
45 'deps' => ['booktics-packages'],
46 'in_footer' => true,
47 ],
48 'booktics-flatpickr-scripts' => [
49 'src' => booktics()->assets_url . '/js/vendors/flatpickr.js',
50 'deps' => [],
51 'in_footer' => true,
52 ],
53 'booktics-packages' => [
54 'src' => booktics()->assets_url . '/build/js/packages.js',
55 'deps' => [],
56 'in_footer' => true,
57 ],
58 ];
59
60 return apply_filters( 'booktics_admin_assets', $scripts );
61 }
62
63 /**
64 * List of register styles
65 *
66 * @return array
67 */
68 public function get_styles(): array {
69 $styles = [
70 'booktics-admin-style' => [
71 'src' => booktics()->assets_url . '/build/css/admin.css',
72 ],
73 'booktics-vendor' => [
74 'src' => booktics()->assets_url . '/build/css/vendor.css',
75 ],
76 ];
77
78 return apply_filters( 'booktics_admin_styles', $styles );
79 }
80 }