Skip to content

Commit

Permalink
shows empty terms in results for search and tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Jul 10, 2020
1 parent d070c1c commit 6d2cb57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/class-wp-rest-term-search-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function search_items( WP_REST_Request $request ) {
array(
'taxonomy' => $taxonomies,
'name__like' => $term_search,
'hide_empty' => false,
)
);

Expand Down
3 changes: 3 additions & 0 deletions phpunit/class-wp-rest-term-search-handler-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function test_get_items_search_type_term() {
$this->assertEquals( 200, $response->get_status() );
$this->assertEqualSets(
array(
0 => 1, // that is the default category
self::$my_category,
self::$my_tag,
),
Expand All @@ -99,6 +100,7 @@ public function test_get_items_search_type_term_subtype_category() {
$this->assertEquals( 200, $response->get_status() );
$this->assertEqualSets(
array(
0 => 1, // that is the default category
self::$my_category,
),
wp_list_pluck( $response->get_data(), 'id' )
Expand Down Expand Up @@ -134,6 +136,7 @@ public function test_get_items_search_categories_and_tags() {
$this->assertEquals( 200, $response->get_status() );
$this->assertEqualSets(
array(
0 => 1, // this is the default category
self::$my_category,
self::$my_tag,
),
Expand Down

0 comments on commit 6d2cb57

Please sign in to comment.