diff --git a/wp-includes/post.php b/wp-includes/post.php index 77a1a49238..fabd68edb2 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -6031,7 +6031,7 @@ function get_pages( $args = array() ) { } $post_author = $post_author->ID; } - $query_args['author__in'][] = $post_author; + $query_args['author__in'][] = (int) $post_author; } } } @@ -6060,6 +6060,16 @@ function get_pages( $args = array() ) { $query_args['posts_per_page'] = $number; } + /** + * Filters query arguments passed to WP_Query in get_pages. + * + * @since 6.3.0 + * + * @param array $query_args Array of arguments passed to WP_Query. + * @param array $parsed_args Array of get_pages() arguments. + */ + $query_args = apply_filters( 'get_pages_query_args', $query_args, $parsed_args ); + $query = new WP_Query( $query_args ); $pages = $query->get_posts(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1236896967..c7778e785e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55844'; +$wp_version = '6.3-alpha-55845'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.