From f0b9d11554225af24384998656cb336f53e279c3 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 31 Jan 2021 16:20:05 +0100 Subject: [PATCH] Add support for two missing taxonomy labels. --- src/class-extended-taxonomy.php | 2 ++ tests/phpunit/Setup.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/class-extended-taxonomy.php b/src/class-extended-taxonomy.php index eb2cf13..56b4d91 100644 --- a/src/class-extended-taxonomy.php +++ b/src/class-extended-taxonomy.php @@ -150,9 +150,11 @@ public function __construct( string $taxonomy, $object_type, array $args = [], a 'menu_name' => $this->tax_plural, 'name' => $this->tax_plural, 'singular_name' => $this->tax_singular, + 'name_admin_bar' => $this->tax_singular, 'search_items' => sprintf( 'Search %s', $this->tax_plural ), 'popular_items' => sprintf( 'Popular %s', $this->tax_plural ), 'all_items' => sprintf( 'All %s', $this->tax_plural ), + 'archives' => sprintf( '%s Archives', $this->tax_plural ), 'parent_item' => sprintf( 'Parent %s', $this->tax_singular ), 'parent_item_colon' => sprintf( 'Parent %s:', $this->tax_singular ), 'edit_item' => sprintf( 'Edit %s', $this->tax_singular ), diff --git a/tests/phpunit/Setup.php b/tests/phpunit/Setup.php index d843098..80490ec 100644 --- a/tests/phpunit/Setup.php +++ b/tests/phpunit/Setup.php @@ -218,6 +218,38 @@ public function testPostTypeLabelsAreCorrect() { } + public function testTaxonomyLabelsAreCorrect() { + $foo = get_taxonomy( 'foo_category' ); + + $this->assertEquals( (object) array( + 'menu_name' => 'Foo Categorys', + 'name' => 'Foo Categorys', + 'singular_name' => 'Foo Category', + 'search_items' => 'Search Foo Categorys', + 'popular_items' => 'Popular Foo Categorys', + 'all_items' => 'All Foo Categorys', + 'parent_item' => 'Parent Foo Category', + 'parent_item_colon' => 'Parent Foo Category:', + 'edit_item' => 'Edit Foo Category', + 'view_item' => 'View Foo Category', + 'update_item' => 'Update Foo Category', + 'add_new_item' => 'Add New Foo Category', + 'new_item_name' => 'New Foo Category Name', + 'separate_items_with_commas' => 'Separate foo categorys with commas', + 'add_or_remove_items' => 'Add or remove foo categorys', + 'choose_from_most_used' => 'Choose from most used foo categorys', + 'not_found' => 'No foo categorys found', + 'no_terms' => 'No foo categorys', + 'items_list_navigation' => 'Foo Categorys list navigation', + 'items_list' => 'Foo Categorys list', + 'most_used' => 'Most Used', + 'back_to_items' => '← Back to Foo Categorys', + 'no_item' => 'No foo category', + 'filter_by' => 'Filter by foo category', + 'name_admin_bar' => 'Foo Category', + 'archives' => 'Foo Categorys Archives', + ), $foo->labels ); + } public function testArchiveLinksAreCorrect() { $link = get_post_type_archive_link( $this->cpts['hello']->post_type );