PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.10
Booktics – Appointment Booking Calendar for Service Businesses v1.0.10
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 / frontend-assets.php

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

73 lines 2.1 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 frontend scripts and styles
6 */
7 class Frontend_Assets extends Base_Assets {
8 /**
9 * Register single service
10 *
11 * @return void
12 */
13 public function register() {
14 add_action( 'wp_enqueue_scripts', [$this, 'register_styles_scripts'] );
15 add_action( 'wp_enqueue_scripts', [$this, 'enqueue'] );
16 }
17
18 /**
19 * Enqueue scripts and styles
20 *
21 * @return void
22 */
23 public function enqueue() {
24
25 wp_localize_script( 'booktics-packages', 'booktics', Localize::get_frontend() );
26 wp_localize_script( 'booktics-packages', 'booktics_enabled_modules', booktics_get_enabled_modules() );
27 }
28
29 /**
30 * Get all scripts
31 *
32 * @return array List register scripts
33 */
34 public function get_scripts(): array {
35 $scripts = [
36 'booktics-frontend-scripts' => [
37 'src' => booktics()->assets_url . '/build/js/frontend.js',
38 'deps' => ['booktics-packages'],
39 'in_footer' => true,
40 ],
41 'booktics-packages' => [
42 'src' => booktics()->assets_url . '/build/js/packages.js',
43 'deps' => ['wp-i18n'],
44 'in_footer' => true,
45 ],
46 'booktics-flatpickr-scripts' => [
47 'src' => booktics()->assets_url . '/js/vendors/flatpickr.js',
48 'deps' => ['wp-plugins', 'wp-i18n', 'wp-element', 'wp-dom', 'wp-data' ],
49 'in_footer' => true,
50 ],
51 ];
52
53 return apply_filters( 'booktics_frontend_assets', $scripts );
54 }
55
56 /**
57 * List of register styles
58 *
59 * @return array
60 */
61 public function get_styles(): array {
62 $styles = [
63 'booktics-vendor' => [
64 'src' => booktics()->assets_url . '/build/css/vendor.css',
65 ],
66 'booktics-frontend' => [
67 'src' => booktics()->assets_url . '/build/css/frontend.css',
68 ],
69 ];
70
71 return apply_filters( 'booktics_frontend_styles', $styles );
72 }
73 }