Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#48854 closed enhancement (invalid)

WP_Query unused code

Reported by: mostafaabd Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.3
Component: Query Keywords:
Focuses: Cc:

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)

#1 @mostafaabd
2 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#2 @SergeyBiryukov
2 years ago

  • Component changed from Database to Query
  • Focuses performance removed
  • Milestone Awaiting Review deleted

Thanks for the ticket! For clarity, since the $query parameter can be a string or array here, wp_parse_args() is called to parse a string of query arguments into an array.

#3 @mostafaabd
2 years ago

thanks , I try to close this ticket before you answer but I think I am failure.

Note: See TracTickets for help on using tickets.