# merchant/2.3.0/inc/modules/global-settings/global-settings.php

Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together &amp; More for WooCommerce – Merchant, version 2.3.0. 67 lines.

- Page: https://pluginprobe.com/plugins/merchant/2.3.0/code/inc/modules/global-settings/global-settings.php
- Raw: https://pluginprobe.com/plugins/merchant/2.3.0/raw/inc/modules/global-settings/global-settings.php
- Modified: 2026-07-21T16:38:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/merchant/2.3.0/code/inc/modules/global-settings/global-settings.php#L10-L20`.

```php
<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * Todo: remove
 *
 * Head custom JS
 * 
 */
function merchant_head_custom_js_first() {
	// Custom JS First - runs at the beginning of Merchant
	$custom_js_first = Merchant_Option::get( 'global-settings', 'custom_js_first', '' );

	if ( ! empty( $custom_js_first ) ) {
		wp_add_inline_script( 'merchant', wp_kses( $custom_js_first, array() ), 'before' );
	}
}
// add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js_first', 11 );

/**
 * Head Custom JS
 * 
 */
function merchant_head_custom_js() {
	$custom_js = Merchant_Option::get( 'global-settings', 'custom_js', '' );

	$custom_js = html_entity_decode( $custom_js, ENT_QUOTES, 'UTF-8' );

	if ( ! empty( $custom_js ) ) {
		// Simple minification
		$minified_js = preg_replace(
			array( '/\/\/.*/', '/\/\*.*?\*\//s', '/\s+/' ),
			array( '', '', ' ' ),
			$custom_js
		);

		wp_add_inline_script( 'merchant', $minified_js );
	}
}

/**
 * `merchant_head_custom_js_priority`
 *
 * @since 2.0.0
 */
add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js', apply_filters( 'merchant_head_custom_js_priority', 12 ) );

/**
 * Todo: remove
 *
 * Head Custom JS Later
 * 
 */
function merchant_head_custom_js_later() {

	// Custom JS Last - runs at the end of Merchant
	$custom_js_last = Merchant_Option::get( 'global-settings', 'custom_js_last', '' );

	if ( ! empty( $custom_js_last ) ) {
		wp_add_inline_script( 'merchant', wp_kses( $custom_js_last, array() ), 'after' );
	}
}
// add_action( 'wp_enqueue_scripts', 'merchant_head_custom_js_later', 13 );

```
