Plugins: Use history.pushState() to customize the URL during searches.

`history.pushState()` requires an event handler for `popstate` which doesn't exist (yet).

Props rahulsprajapati for initial patch.
Fixes #37233.

git-svn-id: https://develop.svn.wordpress.org/trunk@38154 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2016-07-26 20:00:29 +00:00
parent 7f6bfb42fe
commit 86b5cfcb83

View File

@ -2056,8 +2056,8 @@
wp.updates.searchTerm = data.s;
}
if ( window.history && window.history.pushState ) {
window.history.pushState( null, '', searchLocation );
if ( window.history && window.history.replaceState ) {
window.history.replaceState( null, '', searchLocation );
}
if ( ! $searchTab.length ) {
@ -2123,8 +2123,8 @@
wp.updates.searchTerm = data.s;
}
if ( window.history && window.history.pushState ) {
window.history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s );
if ( window.history && window.history.replaceState ) {
window.history.replaceState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s );
}
if ( 'undefined' !== typeof wp.updates.searchRequest ) {