Media Library: Strip additional parameters out of search - #12839
Media Library: Strip additional parameters out of search#12839DanielHudson2 wants to merge 3 commits into
Conversation
… ensure only "search" is selected
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
westonruter
left a comment
There was a problem hiding this comment.
Could you also please undo the code reformatting?
| search: function () { | ||
| var params = new URLSearchParams( window.location.search ); | ||
| var query = params.get( 'search' ) || ''; |
There was a problem hiding this comment.
To preserve back-compat, I think the query should still be used. I suggest finding wherever the query() method is called and fixing at that location how the the search param is extracted from the current location.
There was a problem hiding this comment.
The search param gets extracted by backbone, which greedily matches everything after the search param so i'm not sure a fix through there is possible, i've adjusted so that it continues to use the query but extracts it differently.
df5b234 to
3547b8f
Compare
Rather than relying on the backbone route selected the search url parameter and passed that as the query
Trac ticket: https://core.trac.wordpress.org/ticket/65806
Use of AI Tools
AI assistance: No
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.