Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55806 closed enhancement (duplicate)

`get_pages` should use `WP_Query` internally

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords:
Focuses: Cc:

Description

The function get_pages does raw database calls. It does not use the class WP_Query. This means that performance, bug fixes and filters are not applied to get_pages. To improve maintainability and reduce code, get_pages should be refactored to use WP_Query internally.

Change History (2)

#1 @SergeyBiryukov
2 years ago

Thanks for the ticket!

This was previously discussed in comment:8:ticket:32077, closed in favor of #12821. There are some patches on the latter ticket that could be used as a start. Should we continue there?

Also related: #40650.

#2 @peterwilsoncc
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I fully endorse this, there is some helpful discussion on #12821 so will follow Sergey's suggestion to continue there.

Note: See TracTickets for help on using tickets.