Skip to content

Commit

Permalink
Add support for two missing taxonomy labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Jan 31, 2021
1 parent b8aef5e commit f0b9d11
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/class-extended-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down
32 changes: 32 additions & 0 deletions tests/phpunit/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit f0b9d11

Please sign in to comment.