From b674bd5ef70478e7add3dba248342a9c13b61ead Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Sat, 3 Oct 2026 13:22:28 -0700 Subject: [PATCH] Tests: Use the recognized `ID` orderby value in a query test. `Tests_Query_ThePost::test_wp_query_with_custom_fields_value_populates_the_global_post()` ordered its query by `id`, which `WP_Query` does not recognize. The query fell back to ordering by date, and the fixture pages share a date, so the result depended on the database's tie order. Backports the `thePost.php` change from [64016] to the 6.9 branch. Props jonsurrell, adrianmoldovanwp. See #65893. --- tests/phpunit/tests/query/thePost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/query/thePost.php b/tests/phpunit/tests/query/thePost.php index 6032a01dbeb1b..70e96541838df 100644 --- a/tests/phpunit/tests/query/thePost.php +++ b/tests/phpunit/tests/query/thePost.php @@ -110,7 +110,7 @@ function ( $fields, $query ) { 'fields' => 'custom', 'post_type' => 'page', 'post__in' => self::$page_child_ids, - 'orderby' => 'id', + 'orderby' => 'ID', 'order' => 'ASC', ) );