PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / PaymentGateways / Gateways / Offline / Actions / EnqueueOfflineFormBuilderScripts.php

EnqueueOfflineFormBuilderScripts.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/PaymentGateways/Gateways/Offline/Actions/EnqueueOfflineFormBuilderScripts.php

50 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\PaymentGateways\Gateways\Offline\Actions;
4
5 use Give\PaymentGateways\Gateways\Offline\OfflineGateway;
6
7 class EnqueueOfflineFormBuilderScripts
8 {
9 /**
10 * Enqueues the Stripe scripts and styles for the Form Builder.
11 *
12 * @since 3.16.2 On the "offlineEnabled" option check if the offline gateway is enabled for v3 forms instead of v2 forms
13 *
14 * @return void
15 */
16 public function __invoke()
17 {
18 $scriptAsset = require trailingslashit(GIVE_PLUGIN_DIR) . 'build/offlineGatewayFormBuilder.asset.php';
19
20 wp_enqueue_style(
21 'givewp-offline-gateway-form-builder',
22 GIVE_PLUGIN_URL . 'build/offlineGatewayFormBuilder.css',
23 [],
24 $scriptAsset['version']
25 );
26
27 wp_enqueue_script(
28 'givewp-offline-gateway-form-builder',
29 GIVE_PLUGIN_URL . 'build/offlineGatewayFormBuilder.js',
30 $scriptAsset['dependencies'],
31 $scriptAsset['version'],
32 true
33 );
34
35 wp_add_inline_script(
36 'givewp-offline-gateway-form-builder',
37 'window.giveOfflineGatewaySettings = ' . wp_json_encode(
38 [
39 'offlineEnabled' => give_is_gateway_active(OfflineGateway::id(), 3),
40 'offlineSettingsUrl' => admin_url(
41 'edit.php?post_type=give_forms&page=give-settings&tab=gateways&section=offline-donations'
42 ),
43 'defaultInstructions' => give_get_default_offline_donation_content(),
44 ]
45 ),
46 'before'
47 );
48 }
49 }
50