From d717eed3ad9953e9f6a3481c387157caebc2ebf6 Mon Sep 17 00:00:00 2001 From: Bryce Date: Thu, 13 Nov 2014 15:57:09 +0700 Subject: [PATCH] Add script_debug $suffix for admin settings.js --- includes/admin/class-wc-admin-settings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/admin/class-wc-admin-settings.php b/includes/admin/class-wc-admin-settings.php index 180f242902f..c6812340fc9 100644 --- a/includes/admin/class-wc-admin-settings.php +++ b/includes/admin/class-wc-admin-settings.php @@ -118,9 +118,11 @@ class WC_Admin_Settings { public static function output() { global $current_section, $current_tab; + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + do_action( 'woocommerce_settings_start' ); - wp_enqueue_script( 'woocommerce_settings', WC()->plugin_url() . '/assets/js/admin/settings.min.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'chosen' ), WC()->version, true ); + wp_enqueue_script( 'woocommerce_settings', WC()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'chosen' ), WC()->version, true ); wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array( 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' )