Commit 2e63a5ebf0 for wordpress.org
commit 2e63a5ebf0730865275d9de4a17ce03c7c6f8201
Author: SergeyBiryukov <sergeybiryukov@git.wordpress.org>
Date: Fri Nov 13 23:10:58 2026 +0000
Docs: Clarify how to access results of an existing WP_Query.
Adds a short clarification to the `WP_Query::get_posts()` DocBlock explaining that:
* Query arguments passed to the constructor cause the query to execute.
* The retrieved results are available through the `posts` property.
* Calling `get_posts()` again is unnecessary when the intention is only to access those results.
Props isaeedam.
Fixes #66656.
Built from https://develop.svn.wordpress.org/trunk@65524
git-svn-id: http://core.svn.wordpress.org/trunk@64597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php
index d9827a5ded..56c1c4526d 100644
--- a/wp-includes/class-wp-query.php
+++ b/wp-includes/class-wp-query.php
@@ -1907,6 +1907,11 @@ class WP_Query {
* There are a few filters and actions that can be used to modify the post
* database query.
*
+ * When a WP_Query instance is constructed with non-empty query arguments,
+ * this method is called and the retrieved posts are stored in the `posts`
+ * property. To access those results, use the property instead of calling
+ * this method again, which reprocesses the query and may change its results.
+ *
* @since 1.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index e348a237fb..e01110c13b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta5-65523';
+$wp_version = '7.2-beta5-65524';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.