Ticket #26751: 26751.patch
| File 26751.patch, 2.6 KB (added by , 12 years ago) |
|---|
-
Gruntfile.js
43 43 version: { 44 44 options: { 45 45 processContent: function( src ) { 46 return src.replace( /^(\$wp_version.+?)-src';/m, '$1\';' ); 46 return src.replace( /^\$wp_version = '(.+?)';/m, function( str, version ) { 47 version = version.replace( '-src', '' ); 48 49 if ( /[^0-9.]+/.test( version ) ) { 50 // If the version is alpha|beta|RC 51 version += '-' + ( new Date() ).getTime(); 52 } 53 54 return "$wp_version = '" + version + "';"; 55 }); 47 56 } 48 57 }, 49 58 files: [ -
src/wp-includes/script-loader.php
50 50 function wp_default_scripts( &$scripts ) { 51 51 include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version 52 52 53 $is_src = ( false !== strpos( $wp_version, '-src' ) ); 54 53 55 if ( ! defined( 'SCRIPT_DEBUG' ) ) 54 define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ));56 define( 'SCRIPT_DEBUG', $is_src ); 55 57 56 58 if ( ! $guessurl = site_url() ) { 57 59 $guessed_url = true; … … 65 67 66 68 $suffix = SCRIPT_DEBUG ? '' : '.min'; 67 69 70 if ( $is_src ) { 71 // When running from /src refresh browser cache on every load 72 $scripts->default_version .= time(); 73 } 74 68 75 $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" ); 69 76 did_action( 'init' ) && $scripts->localize( 'utils', 'userSettings', array( 70 77 'url' => (string) SITECOOKIEPATH, … … 533 540 function wp_default_styles( &$styles ) { 534 541 include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version 535 542 543 $is_src = ( false !== strpos( $wp_version, '-src' ) ); 544 536 545 if ( ! defined( 'SCRIPT_DEBUG' ) ) 537 define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ));546 define( 'SCRIPT_DEBUG', $is_src ); 538 547 539 548 if ( ! $guessurl = site_url() ) 540 549 $guessurl = wp_guess_url(); … … 547 556 548 557 $suffix = SCRIPT_DEBUG ? '' : '.min'; 549 558 559 if ( $is_src ) { 560 // When running from /src refresh browser cache on every load 561 $styles->default_version .= time(); 562 } 563 550 564 $rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls', 'media-views', 'wp-color-picker', 'wp-pointer', 'editor-buttons', 'farbtastic', 'wp-auth-check', 'wp-jquery-ui-dialog', 'media-views', 'buttons', 'install', 'colors-fresh' ); 551 565 552 566 $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array( 'open-sans', 'dashicons' ) );