Sergey Biryukov
e70b0f7c3d
Tests: Avoid duplicate queries in some WP_Query tests.
...
When passing args to the `WP_Query::__construct()` method, it internally executes the `WP_Query::get_posts()` method and stores the result in the `WP_Query::posts` property.
When calling `WP_Query::get_posts()` again, the same SQL query gets executed, and the result is again stored in the `WP_Query::posts` property.
Thus, the correct usage is to read the posts already stored in the `WP_Query::posts` property.
Follow-up to [1062/tests], [1065/tests], [1066/tests], [1070/tests], [29805], [31286], [49900], [51144].
Props david.binda.
Fixes #54822 .
git-svn-id: https://develop.svn.wordpress.org/trunk@52577 602fd350-edb4-49c9-b593-d223f7449a82
2022-01-14 17:50:52 +00:00
..
2021-11-04 15:22:47 +00:00
2022-01-12 23:29:03 +00:00
2021-12-14 15:31:14 +00:00
2021-11-04 15:22:47 +00:00
2022-01-04 05:37:25 +00:00
2021-12-18 21:44:57 +00:00
2021-12-21 00:10:26 +00:00
2021-11-04 15:22:47 +00:00
2021-08-26 12:57:08 +00:00
2021-11-19 20:22:43 +00:00
2021-11-08 14:21:44 +00:00
2021-08-30 15:19:38 +00:00
2021-11-04 15:22:47 +00:00
2021-12-19 13:42:37 +00:00
2021-11-25 19:39:31 +00:00
2021-11-08 13:23:44 +00:00
2021-08-20 16:11:04 +00:00
2021-08-21 15:32:53 +00:00
2021-12-30 16:27:48 +00:00
2021-12-06 21:29:00 +00:00
2021-11-04 15:22:47 +00:00
2021-12-14 14:59:33 +00:00
2021-12-15 19:59:32 +00:00
2021-11-11 16:27:44 +00:00
2021-12-19 13:42:37 +00:00
2021-12-15 19:59:32 +00:00
2021-12-19 13:42:37 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-11-25 19:39:31 +00:00
2021-12-02 05:39:57 +00:00
2021-11-04 15:22:47 +00:00
2021-11-16 21:23:12 +00:00
2021-11-25 19:39:31 +00:00
2021-11-25 19:39:31 +00:00
2021-11-18 15:10:18 +00:00
2022-01-04 15:22:40 +00:00
2021-12-10 20:28:27 +00:00
2021-11-04 15:22:47 +00:00
2021-12-19 13:42:37 +00:00
2021-08-07 10:29:41 +00:00
2022-01-14 17:50:52 +00:00
2022-01-04 14:23:56 +00:00
2021-12-19 13:42:37 +00:00
2021-11-04 15:22:47 +00:00
2021-08-07 10:29:41 +00:00
2021-12-19 13:42:37 +00:00
2022-01-04 05:37:25 +00:00
2020-11-15 13:59:32 +00:00
2021-12-19 13:42:37 +00:00
2021-12-06 21:29:00 +00:00
2021-08-16 20:16:13 +00:00
2021-12-19 13:42:37 +00:00
2021-12-19 13:42:37 +00:00
2021-11-04 15:22:47 +00:00
2021-11-15 01:08:35 +00:00
2021-08-06 21:52:06 +00:00
2021-11-04 15:22:47 +00:00
2021-12-07 12:10:36 +00:00
2021-12-02 23:35:20 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-12-19 13:42:37 +00:00
2021-11-19 18:58:14 +00:00
2021-11-04 15:22:47 +00:00
2021-12-07 17:44:46 +00:00
2021-12-19 13:42:37 +00:00
2021-11-04 15:22:47 +00:00
2021-12-06 21:29:00 +00:00
2021-08-26 12:57:08 +00:00
2021-08-26 12:57:08 +00:00
2021-12-06 11:06:40 +00:00
2021-11-27 16:16:15 +00:00
2021-11-04 15:22:47 +00:00
2021-08-07 10:29:41 +00:00
2021-11-04 15:22:47 +00:00
2021-11-16 21:23:12 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-07-12 10:35:44 +00:00
2021-12-19 13:42:37 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-12-19 13:42:37 +00:00
2021-08-26 12:57:08 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-12-19 13:42:37 +00:00
2021-08-07 10:29:41 +00:00
2021-12-19 13:42:37 +00:00
2022-01-04 18:38:52 +00:00
2021-11-04 15:22:47 +00:00
2021-11-04 15:22:47 +00:00
2021-12-19 13:42:37 +00:00
2021-11-04 15:22:47 +00:00
2021-11-27 16:16:15 +00:00
2021-08-07 10:29:41 +00:00