PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.17
Booktics – Appointment Booking Calendar for Service Businesses v1.0.17
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.17, at core/assets/frontend-assets.php

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