Skip to content

Commit bd1c1ac

Browse files
Test orderby array all invalid fields fallback
1 parent 9778e43 commit bd1c1ac

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/phpunit/tests/term/query.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,4 +1308,33 @@ public function test_orderby_array_backward_compatibility() {
13081308

13091309
$this->assertSame( $terms, $q2->terms );
13101310
}
1311+
1312+
/**
1313+
* @ticket 63890
1314+
*/
1315+
public function test_orderby_array_all_invalid_fields_fallback() {
1316+
register_taxonomy( 'wptests_tax_fallback', 'post' );
1317+
1318+
$terms = self::factory()->term->create_many(
1319+
2,
1320+
array(
1321+
'taxonomy' => 'wptests_tax_fallback',
1322+
)
1323+
);
1324+
1325+
$q = new WP_Term_Query(
1326+
array(
1327+
'taxonomy' => 'wptests_tax_fallback',
1328+
'orderby' => array(
1329+
'invalid_field1' => 'ASC',
1330+
'invalid_field2' => 'DESC',
1331+
),
1332+
'hide_empty' => false,
1333+
'fields' => 'ids',
1334+
)
1335+
);
1336+
1337+
$this->assertNotEmpty( $q->terms );
1338+
$this->assertCount( 2, $q->terms );
1339+
}
13111340
}

0 commit comments

Comments
 (0)