PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.6
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.6
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.6, at inc/modules/global-settings/global-settings.php

53 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 ( ! 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 }
21 add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js_first', 11 );
22
23 /**
24 * Head Custom JS
25 *
26 */
27 function merchant_head_custom_js() {
28
29 // Custom JS
30 $custom_js = Merchant_Option::get( 'global-settings', 'custom_js', '' );
31
32 if ( ! empty( $custom_js ) ) {
33 wp_add_inline_script( 'merchant', wp_kses( $custom_js, array() ), 'after' );
34 }
35
36 }
37 add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js', 12 );
38
39 /**
40 * Head Custom JS Later
41 *
42 */
43 function merchant_head_custom_js_later() {
44
45 // Custom JS Last - runs at the end of Merchant
46 $custom_js_last = Merchant_Option::get( 'global-settings', 'custom_js_last', '' );
47
48 if ( ! empty( $custom_js_last ) ) {
49 wp_add_inline_script( 'merchant', wp_kses( $custom_js_last, array() ), 'after' );
50 }
51
52 }
53 add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js_later', 13 );