[wp-trac] [WordPress Trac] #23367: Remove message parameters from admin URl's in the browser address bar

WordPress Trac noreply at wordpress.org
Sat Jan 24 05:56:53 UTC 2015


#23367: Remove message parameters from admin URl's in the browser address bar
-------------------------------------------------+-------------------------
 Reporter:  mark-k                               |       Owner:
     Type:  enhancement                          |  morganestes
 Priority:  low                                  |      Status:  assigned
Component:  Administration                       |   Milestone:  Future
 Severity:  minor                                |  Release
 Keywords:  good-first-bug has-patch needs-      |     Version:
  unit-tests                                     |  Resolution:
                                                 |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------
Changes (by morganestes):

 * keywords:  good-first-bug has-patch needs-refresh => good-first-bug has-
     patch needs-unit-tests


Comment:

 Here's the summary of what I came up with:

 - Added utility functions to the `wp.url` namespace object to handle URL
 string manipulations and placed it in `wp-utils.js`.
 - Localized the script to pass an array of parameters to remove from the
 query string.
 - Created a filter for the array of parameters so they can be modified
 outside the main code.
 - Added a global Object `wpUrlParams` that contains a map of the original
 parameters and their values prior to being filtered.

 * Note that the actual URL filter relies on `document.pushState`, which
 isn't supported in IE 9 or lower without a polyfill. Those browsers will
 get access to `wpUrlParams` but not the URL changes, which is current
 behavior.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/23367#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list