WCAdminAssets::should_use_minified_js_file()public staticWC 1.0

Determines if a minified JS file should be served.

Method of the class: WCAdminAssets{}

No Hooks.


true|false. If js asset should use minified version.


$result = WCAdminAssets::should_use_minified_js_file( $script_debug );
$script_debug(true|false) (required)
Only serve unminified files if script debug is on.

WCAdminAssets::should_use_minified_js_file() code WC 8.7.0

public static function should_use_minified_js_file( $script_debug ) {
	// minified files are only shipped in non-core versions of wc-admin, return false if minified files are not available.
	if ( ! Features::exists( 'minified-js' ) ) {
		return false;

	// Otherwise we will serve un-minified files if SCRIPT_DEBUG is on, or if anything truthy is passed in-lieu of SCRIPT_DEBUG.
	return ! $script_debug;