[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 17:33:36 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
-------------------------------------------------+-------------------------

Comment (by morganestes):

 Replying to [comment:11 wonderboymusic]:
 > @morganestes: thanks! see:
 https://core.trac.wordpress.org/ticket/23367#comment:7
 Sorry, read that last night and immediately forgot it when I started
 working on the code. I'll work on implementing it.
 >
 > `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.
 What's the preferred approach for the JS object: create a new one or
 attach it to an existing one? If existing, which one is best for general
 use?
 >
 > `location` doesn't need to be wrapped in jQuery, just read
 `window.location.href`
 Yep, makes sense. I'll make the switch.
 >
 > 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.
 I'll see what I can do. I'm imagining this being the utility function
 that's used to generate the JSON output mentioned above.

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


More information about the wp-trac mailing list