WCAdminAssets::should_use_minified_js_file()public staticWC 1.0

Determines if a minified JS file should be served.

Метод класса: WCAdminAssets{}

Хуков нет.


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


$result = WCAdminAssets::should_use_minified_js_file( $script_debug );
$script_debug(true|false) (обязательный)
Only serve unminified files if script debug is on.

Код WCAdminAssets::should_use_minified_js_file() WC 8.9.3

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;