PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.93
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.93
3.0.63 3.0.62 3.0.61 3.0.60 3.0.49.49 3.0.49.6 3.0.49.60 3.0.49.61 3.0.49.62 3.0.49.63 3.0.49.64 3.0.49.66 3.0.49.67 3.0.49.69 3.0.49.7 3.0.49.70 3.0.49.72 3.0.49.73 3.0.49.74 3.0.49.76 3.0.49.77 3.0.49.79 3.0.49.9 3.0.49.90 3.0.49.91 3.0.49.92 3.0.49.93 3.0.49.94 3.0.49.96 3.0.49.97 3.0.49.99 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 2.9.17 3.0.47 3.0.49 3.0.49.1 3.0.49.10 3.0.49.11 3.0.49.12 3.0.49.13 3.0.49.16 3.0.49.17 3.0.49.19 3.0.49.2 3.0.49.20 3.0.49.21 3.0.49.22 3.0.49.23 3.0.49.24 3.0.49.26 3.0.49.27 3.0.49.29 3.0.49.3 3.0.49.30 3.0.49.31 3.0.49.32 3.0.49.33 3.0.49.34 3.0.49.36 3.0.49.37 3.0.49.39 3.0.49.4 3.0.49.40 3.0.49.41 3.0.49.42 3.0.49.43 3.0.49.44 3.0.49.46 3.0.49.47
pi-woocommerce-order-date-time-and-type / block / class-date-time-location-block-integration.php
pi-woocommerce-order-date-time-and-type / block Last commit date
date-time-location 4 months ago class-date-time-location-block-integration.php 4 months ago class-date-time-location-block.php 4 months ago class-date-time-location-storage.php 4 months ago
class-date-time-location-block-integration.php
89 lines
1 <?php
2 /**
3 *
4 */
5
6 use Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface;
7
8
9 class Date_Time_Location_Block_Integration implements IntegrationInterface {
10
11 /**
12 * The name of the integration.
13 *
14 * @return string
15 */
16 public function get_name() {
17 return 'date-time-location';
18 }
19
20 /**
21 * When called invokes any initialization/setup for the integration.
22 */
23 public function initialize() {
24 $this->register_block_frontend_scripts();
25 }
26
27 /**
28 * Returns an array of script handles to enqueue in the frontend context.
29 *
30 * @return string[]
31 */
32 public function get_script_handles() {
33 return array( 'pisol-dtt-date-time-location-block','jquery-ui-datepicker' );
34 }
35
36 /**
37 * Returns an array of script handles to enqueue in the editor context.
38 *
39 * @return string[]
40 */
41 public function get_editor_script_handles() {
42 return [];
43 }
44
45 /**
46 * An array of key, value pairs of data made available to the block on the client side.
47 *
48 * @return array
49 */
50 public function get_script_data() {
51 return array();
52 }
53
54 /**
55 * Register scripts for delivery date block editor.
56 *
57 * @return void
58 */
59 public function register_block_editor_scripts() {
60
61 }
62
63 /**
64 * Register scripts for frontend block.
65 *
66 * @return void
67 */
68 public function register_block_frontend_scripts() {
69 wp_register_script( 'pisol-dtt-date-time-location-block', plugin_dir_url( __FILE__ ) . 'date-time-location/js/date-time-block.js', array( 'wp-plugins', 'wc-blocks-checkout','jquery-ui-datepicker' ), $this->get_file_version(plugin_dir_path( __FILE__ ) . 'date-time-location/js/date-time-block.js'), true );
70
71 wp_enqueue_style( 'pisol-dtt-date-time-location-block', plugin_dir_url( __FILE__ ) . 'date-time-location/css/date-time-block.css', array(), $this->get_file_version(plugin_dir_path( __FILE__ ) . 'date-time-location/css/date-time-block.css') );
72
73 \pi_dtt_css::inlineCss('pisol-dtt-date-time-location-block');
74 }
75
76 /**
77 * Get the file modified time as a cache buster if we're in dev mode.
78 *
79 * @param string $file Local path to the file.
80 * @return string The cache buster value to use for the given file.
81 */
82 protected function get_file_version( $file ) {
83 if ( defined( 'WP_DEBUG' ) && WP_DEBUG && file_exists( $file ) ) {
84 return filemtime( $file );
85 }
86 return PISOL_DTT_PLUGIN_VERSION;
87 }
88
89 }