| @@ 76-101 (lines=26) @@ | ||
| 73 | /** |
|
| 74 | * @ticket 27810 |
|
| 75 | */ |
|
| 76 | public function test_field_name_should_work_for_names_with_spaces() |
|
| 77 | { |
|
| 78 | register_taxonomy('wptests_tax', 'post'); |
|
| 79 | ||
| 80 | $t = self::factory()->term->create( |
|
| 81 | array( |
|
| 82 | 'taxonomy' => 'wptests_tax', |
|
| 83 | 'slug' => 'foo', |
|
| 84 | 'name' => 'Foo Bar', |
|
| 85 | ) |
|
| 86 | ); |
|
| 87 | $p1 = self::factory()->post->create(); |
|
| 88 | $p2 = self::factory()->post->create(); |
|
| 89 | ||
| 90 | wp_set_object_terms($p1, $t, 'wptests_tax'); |
|
| 91 | ||
| 92 | $q = new WP_Query( |
|
| 93 | array( |
|
| 94 | 'fields' => 'ids', |
|
| 95 | 'tax_query' => array( |
|
| 96 | array( |
|
| 97 | 'taxonomy' => 'wptests_tax', |
|
| 98 | 'terms' => array( 'Foo Bar' ), |
|
| 99 | 'field' => 'name', |
|
| 100 | ), |
|
| 101 | ), |
|
| 102 | ) |
|
| 103 | ); |
|
| 104 | ||
| @@ 1452-1474 (lines=23) @@ | ||
| 1449 | /** |
|
| 1450 | * @ticket 33726 |
|
| 1451 | */ |
|
| 1452 | public function test_orderby_term_id() |
|
| 1453 | { |
|
| 1454 | register_taxonomy('wptests_tax', 'post'); |
|
| 1455 | $t1 = self::factory()->term->create( |
|
| 1456 | array( |
|
| 1457 | 'taxonomy' => 'wptests_tax', |
|
| 1458 | 'name' => 'AAA', |
|
| 1459 | ) |
|
| 1460 | ); |
|
| 1461 | $t2 = self::factory()->term->create( |
|
| 1462 | array( |
|
| 1463 | 'taxonomy' => 'wptests_tax', |
|
| 1464 | 'name' => 'ZZZ', |
|
| 1465 | ) |
|
| 1466 | ); |
|
| 1467 | $t3 = self::factory()->term->create( |
|
| 1468 | array( |
|
| 1469 | 'taxonomy' => 'wptests_tax', |
|
| 1470 | 'name' => 'JJJ', |
|
| 1471 | ) |
|
| 1472 | ); |
|
| 1473 | ||
| 1474 | $found = get_terms( |
|
| 1475 | 'wptests_tax', array( |
|
| 1476 | 'orderby' => 'term_id', |
|
| 1477 | 'hide_empty' => false, |
|