Opened 7 years ago
Closed 7 years ago
#3607 closed defect (bug) (duplicate)
Change the way public query vars are added for the handbooks and searchform
Reported by: | keesiemeijer | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | has-patch |
Cc: |
Description
The query_vars
filter uses a numerically indexed array to store the public query vars. The handbook and the searchform are adding query vars as an associative array (with default values).
The following patch adds the query vars in the proper way.
This will not affect the way the query vars behave. Newly added query vars have a falsy
value by default.
The question is if we even need to add them. There are no custom rewrite rules that use these query vars, and we don't use them as query args in the front end.
Attachments (1)
Change History (3)
#1
@
7 years ago
I'm not even sure that these functions are doing anything of value, like, they can't even be used in rewrite rules if they wanted to be.
The only locations where the result of the filter is used, only uses the values and not the keys of the filter are used:
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp.php?marks=287,295#L275
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/rewrite.php?marks=596#L591
Add query vars the proper way