File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,48 @@ public function test_object_ids_cache_should_be_invalidated_by_term_relationship
451451 $ this ->assertSameSets ( array ( $ terms [1 ] ), $ found );
452452 }
453453
454+ /**
455+ *
456+ * @ticket 63256
457+ */
458+ public function test_object_ids_null_should_return_all_terms () {
459+ register_taxonomy ( 'wptests_tax_1 ' , 'post ' );
460+
461+ $ terms = self ::factory ()->term ->create_many ( 3 , array ( 'taxonomy ' => 'wptests_tax_1 ' ) );
462+
463+ $ query = new WP_Term_Query (
464+ array (
465+ 'taxonomy ' => 'wptests_tax_1 ' ,
466+ 'object_ids ' => null ,
467+ 'hide_empty ' => false ,
468+ 'fields ' => 'ids ' ,
469+ )
470+ );
471+
472+ $ this ->assertSameSets ( $ terms , $ query ->terms );
473+ }
474+
475+ /**
476+ *
477+ * @ticket 63256
478+ */
479+ public function test_object_ids_zero_should_be_treated_as_numeric () {
480+ register_taxonomy ( 'wptests_tax_1 ' , 'post ' );
481+
482+ $ term = self ::factory ()->term ->create ( array ( 'taxonomy ' => 'wptests_tax_1 ' ) );
483+
484+ $ query = new WP_Term_Query (
485+ array (
486+ 'taxonomy ' => 'wptests_tax_1 ' ,
487+ 'object_ids ' => 0 ,
488+ 'hide_empty ' => false ,
489+ 'fields ' => 'ids ' ,
490+ )
491+ );
492+
493+ $ this ->assertIsArray ( $ query ->terms );
494+ }
495+
454496 /**
455497 * @ticket 38295
456498 * @group cache
You can’t perform that action at this time.
0 commit comments