Customize: Allow (optional) `url` parameter to be omitted in intercepted calls to `history.pushState()` and `history.replaceState()` in customize preview.
Fixes issue where calls without the `url` parameter erroneously end up rewriting the location path to `/undefined`. Props Christian1012, westonruter. Fixes #39175. Built from https://develop.svn.wordpress.org/trunk@39547 git-svn-id: http://core.svn.wordpress.org/trunk@39487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
592c3fc7d7
commit
d10cde75c6
|
@ -49,14 +49,14 @@
|
||||||
history.replaceState = ( function( nativeReplaceState ) {
|
history.replaceState = ( function( nativeReplaceState ) {
|
||||||
return function historyReplaceState( data, title, url ) {
|
return function historyReplaceState( data, title, url ) {
|
||||||
currentHistoryState = data;
|
currentHistoryState = data;
|
||||||
return nativeReplaceState.call( history, data, title, injectUrlWithState( url ) );
|
return nativeReplaceState.call( history, data, title, 'string' === typeof url && url.length > 0 ? injectUrlWithState( url ) : url );
|
||||||
};
|
};
|
||||||
} )( history.replaceState );
|
} )( history.replaceState );
|
||||||
|
|
||||||
history.pushState = ( function( nativePushState ) {
|
history.pushState = ( function( nativePushState ) {
|
||||||
return function historyPushState( data, title, url ) {
|
return function historyPushState( data, title, url ) {
|
||||||
currentHistoryState = data;
|
currentHistoryState = data;
|
||||||
return nativePushState.call( history, data, title, injectUrlWithState( url ) );
|
return nativePushState.call( history, data, title, 'string' === typeof url && url.length > 0 ? injectUrlWithState( url ) : url );
|
||||||
};
|
};
|
||||||
} )( history.pushState );
|
} )( history.pushState );
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.8-alpha-39546';
|
$wp_version = '4.8-alpha-39547';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
Loading…
Reference in New Issue