Define `SCRIPT_DEBUG` early on every load, similarly to `WP_DEBUG`. Remove `defined( 'SCRIPT_DEBUG' )` checks.

Fixes #32333.
Built from https://develop.svn.wordpress.org/trunk@32935


git-svn-id: http://core.svn.wordpress.org/trunk@32906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-06-25 02:29:31 +00:00
parent d4f3428d5f
commit eaadfde950
6 changed files with 18 additions and 7 deletions

View File

@ -542,7 +542,7 @@ final class _WP_Editors {
self::$first_init['external_plugins'] = wp_json_encode( $mce_external_plugins ); self::$first_init['external_plugins'] = wp_json_encode( $mce_external_plugins );
} }
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $suffix = SCRIPT_DEBUG ? '' : '.min';
$version = 'ver=' . $wp_version; $version = 'ver=' . $wp_version;
$dashicons = includes_url( "css/dashicons$suffix.css?$version" ); $dashicons = includes_url( "css/dashicons$suffix.css?$version" );
@ -1134,7 +1134,7 @@ final class _WP_Editors {
'language' => self::$mce_locale 'language' => self::$mce_locale
); );
$suffix = ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) ? '' : '.min'; $suffix = SCRIPT_DEBUG ? '' : '.min';
/** /**
* Fires immediately before the TinyMCE settings are printed. * Fires immediately before the TinyMCE settings are printed.

View File

@ -71,6 +71,18 @@ function wp_initial_constants() {
if ( !defined('WP_CACHE') ) if ( !defined('WP_CACHE') )
define('WP_CACHE', false); define('WP_CACHE', false);
// Add define('SCRIPT_DEBUG', true); to wp-config.php to enable loading of non-minified,
// non-concatenated scripts and stylesheets.
if ( ! defined( 'SCRIPT_DEBUG' ) ) {
if ( ! empty( $GLOBALS['wp_version'] ) ) {
$develop_src = false !== strpos( $GLOBALS['wp_version'], '-src' );
} else {
$develop_src = false;
}
define( 'SCRIPT_DEBUG', $develop_src );
}
/** /**
* Private * Private
*/ */

View File

@ -4255,9 +4255,8 @@ function print_emoji_detection_script() {
); );
$version = 'ver=' . $wp_version; $version = 'ver=' . $wp_version;
$develop_src = false !== strpos( $wp_version, '-src' );
if ( $develop_src || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) { if ( SCRIPT_DEBUG ) {
$settings['source'] = array( $settings['source'] = array(
/** This filter is documented in wp-includes/class.wp-scripts.php */ /** This filter is documented in wp-includes/class.wp-scripts.php */
'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ), 'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ),

View File

@ -2841,7 +2841,7 @@ function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = arra
*/ */
function register_admin_color_schemes() { function register_admin_color_schemes() {
$suffix = is_rtl() ? '-rtl' : ''; $suffix = is_rtl() ? '-rtl' : '';
$suffix .= defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $suffix .= SCRIPT_DEBUG ? '' : '.min';
wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ), wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
false, false,

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-alpha-32934'; $wp_version = '4.3-alpha-32935';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -29,7 +29,7 @@ require( ABSPATH . WPINC . '/default-constants.php' );
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version; global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;
require( ABSPATH . WPINC . '/version.php' ); require( ABSPATH . WPINC . '/version.php' );
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE.
wp_initial_constants(); wp_initial_constants();
// Check for the required PHP version and for the MySQL extension or a database drop-in. // Check for the required PHP version and for the MySQL extension or a database drop-in.