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.
Built from https://develop.svn.wordpress.org/trunk@38154


git-svn-id: http://core.svn.wordpress.org/trunk@38095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-07-26 20:01:28 +00:00
parent 8f6517c275
commit de5a513027
3 changed files with 6 additions and 6 deletions

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 ) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-beta4-38153';
$wp_version = '4.6-beta4-38154';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.