WordPress.org

Make WordPress Core

Changeset 38154


Ignore:
Timestamp:
07/26/2016 08:00:29 PM (4 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/updates.js

    r38119 r38154  
    20572057            }
    20582058
    2059             if ( window.history && window.history.pushState ) {
    2060                 window.history.pushState( null, '', searchLocation );
     2059            if ( window.history && window.history.replaceState ) {
     2060                window.history.replaceState( null, '', searchLocation );
    20612061            }
    20622062
     
    21242124            }
    21252125
    2126             if ( window.history && window.history.pushState ) {
    2127                 window.history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s );
     2126            if ( window.history && window.history.replaceState ) {
     2127                window.history.replaceState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s );
    21282128            }
    21292129
Note: See TracChangeset for help on using the changeset viewer.