PluginProbe
Route ‑ Shipping Protection / 2.4.4
Route ‑ Shipping Protection v2.4.4
2.4.19 2.4.18 2.4.17 2.4.16 2.4.15 2.4.14 2.4.13 2.4.12 2.4.11 2.4.10 2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.2.4 2.2.5 2.2.6 2.2.8 2.2.9 2.3.0 2.3.1 All 153 releases
routeapp / includes / class-routeapp-blocks-integration.php

class-routeapp-blocks-integration.php in Route ‑ Shipping Protection 2.4.4, at includes/class-routeapp-blocks-integration.php

58 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! interface_exists( 'Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface' ) ) {
4 return;
5 }
6
7 use Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface;
8
9 /**
10 * Route Protection block integration with WooCommerce Blocks checkout.
11 *
12 * Enqueues the script that registers the additionalCartCheckoutInnerBlockTypes
13 * filter so the Route block is allowed inside checkout inner-block areas.
14 */
15 class Routeapp_Blocks_Integration implements IntegrationInterface {
16
17 /**
18 * @return string
19 */
20 public function get_name() {
21 return 'route-protection';
22 }
23
24 /**
25 * Register frontend script that whitelists the block in checkout areas.
26 */
27 public function initialize() {
28 wp_register_script(
29 'route-protection-block-frontend',
30 plugins_url( 'blocks/route-protection/frontend.js', dirname( __FILE__ ) ),
31 array(),
32 defined( 'ROUTEAPP_VERSION' ) ? ROUTEAPP_VERSION : '1.0.0',
33 true
34 );
35 }
36
37 /**
38 * @return string[]
39 */
40 public function get_script_handles() {
41 return array( 'route-protection-block-frontend' );
42 }
43
44 /**
45 * @return string[]
46 */
47 public function get_editor_script_handles() {
48 return array( 'route-protection-block-frontend' );
49 }
50
51 /**
52 * @return array
53 */
54 public function get_script_data() {
55 return array();
56 }
57 }
58