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

WordPress Trac noreply at wordpress.org
Tue Jan 20 04:59:20 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:
  refresh                                        |  Resolution:
                                                 |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------
Changes (by wonderboymusic):

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


Comment:

 @morganestes: thanks! see:
 https://core.trac.wordpress.org/ticket/23367#comment:7

 `common.js` should be localized using `wp_localize_script()` to read the
 query params to remove, instead of listing them in the file. This future-
 proofs the code when new query params are added.

 `location` doesn't need to be wrapped in jQuery, just read
 `window.location.href`

 I would use this as an opportunity to introduce some query string JS
 functions to read all of the params and parse them into a map - something
 that could possibly be added into `wp-util.js`. That way you could do:

 {{{
 params = get_query_params(); <----- not a good name
 _.each( localizedParams, function (key) {
     delete params[ key ];
 } );
 }}}

 Or use some Underscore function to get the difference between the 2 based
 on keys.

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


More information about the wp-trac mailing list