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 / localize.php

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

51 lines 1.8 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 localize data
6 */
7 class Localize {
8
9 /**
10 * Get admin localize data
11 *
12 * @return array Collection localize data
13 */
14 public static function get_admin() {
15 $data = [
16 'site_url' => site_url(),
17 'admin_url' => admin_url(),
18 'nonce' => wp_create_nonce( 'wp_rest' ),
19 'date_format' => get_option( 'date_format' ),
20 'date_format_string' => date_i18n( get_option( 'date_format' ) ),
21 'time_format' => get_option( 'time_format' ),
22 'time_format_string' => date_i18n( get_option( 'time_format' ) ),
23 'start_of_week' => get_option( 'start_of_week', 0 ),
24 'current_user_id' => get_current_user_id(),
25 'currency_list' => booktics_get_currencies(),
26 'bookticsPro' => class_exists('BookticsPro') ? true : false,
27 ];
28
29 return apply_filters( 'booktics_admin_localize', $data );
30 }
31
32 /**
33 * Get frontend localize data
34 *
35 * @return array Collection localize data
36 */
37 public static function get_frontend() {
38 $data = [
39 'site_url' => site_url(),
40 'nonce' => wp_create_nonce( 'wp_rest' ),
41 'date_format' => get_option( 'date_format' ),
42 'time_format' => get_option( 'time_format' ),
43 'current_user_id' => get_current_user_id(),
44 'start_of_week' => get_option( 'start_of_week', 0 ),
45 'locale_name' => strtolower( str_replace( '_', '-', get_locale() ) ),
46 'currency_list' => booktics_get_currencies(),
47 ];
48
49 return apply_filters( 'booktics_frontend_localize', $data );
50 }
51 }