PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.10.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.10.2
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / inc / modules / global-settings / global-settings.php

global-settings.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.10.2, at inc/modules/global-settings/global-settings.php

50 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly
5 }
6
7 /**
8 * Head custom JS
9 *
10 */
11 function merchant_head_custom_js_first() {
12
13 // Custom JS First - runs at the beginning of Merchant
14 $custom_js_first = Merchant_Option::get( 'global-settings', 'custom_js_first', '' );
15
16 if ( ! empty( $custom_js_first ) ) {
17 wp_add_inline_script( 'merchant', wp_kses( $custom_js_first, array() ), 'before' );
18 }
19 }
20 add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js_first', 11 );
21
22 /**
23 * Head Custom JS
24 *
25 */
26 function merchant_head_custom_js() {
27
28 // Custom JS
29 $custom_js = Merchant_Option::get( 'global-settings', 'custom_js', '' );
30
31 if ( ! empty( $custom_js ) ) {
32 wp_add_inline_script( 'merchant', wp_kses( $custom_js, array() ), 'after' );
33 }
34 }
35 add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js', 12 );
36
37 /**
38 * Head Custom JS Later
39 *
40 */
41 function merchant_head_custom_js_later() {
42
43 // Custom JS Last - runs at the end of Merchant
44 $custom_js_last = Merchant_Option::get( 'global-settings', 'custom_js_last', '' );
45
46 if ( ! empty( $custom_js_last ) ) {
47 wp_add_inline_script( 'merchant', wp_kses( $custom_js_last, array() ), 'after' );
48 }
49 }
50 add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js_later', 13 );