#48854 closed enhancement (invalid)
WP_Query unused code
| Reported by: | mostafaabd | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | 5.3 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
https://core.trac.wordpress.org/browser/tags/5.3/src/wp-includes/class-wp-query.php#L3411
inside function query on line 3411
$this->query = wp_parse_args( $query );
I think wp_parse_args take 2 arguments to Merge a user defined arguments into defaults array.
but here we only path one parameter
so I think its good to remove this function to be
$this->query = $query;
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the ticket! For clarity, since the
$queryparameter can be a string or array here,wp_parse_args()is called to parse a string of query arguments into an array.