mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-10 21:00:59 +01:00
Posts, Post Types: Avoid redundant SQL query in get_pages().
This avoids an additional query by passing the query args directly to the `WP_Query::query()` method, rather than to the constructor and calling get_posts(), following [55569]. Props david.binda, azaozz, spacedmonkey, mukesh27, flixos90, SergeyBiryukov, joemcgill. Merges [56491] to the 6.3 branch. Fixes #59224. Built from https://develop.svn.wordpress.org/branches/6.3@56516 git-svn-id: http://core.svn.wordpress.org/branches/6.3@56028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f732f19520
commit
bedc3be9f2
@ -6091,8 +6091,8 @@ function get_pages( $args = array() ) {
|
||||
*/
|
||||
$query_args = apply_filters( 'get_pages_query_args', $query_args, $parsed_args );
|
||||
|
||||
$query = new WP_Query( $query_args );
|
||||
$pages = $query->get_posts();
|
||||
$pages = new WP_Query();
|
||||
$pages = $pages->query( $query_args );
|
||||
|
||||
if ( $child_of || $hierarchical ) {
|
||||
$pages = get_page_children( $child_of, $pages );
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.3.2-alpha-56487';
|
||||
$wp_version = '6.3.2-alpha-56516';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user