Function: get_taxonomy_labels

get_taxonomy_labels( WP_Taxonomy $tax )

Builds an object with all taxonomy labels out of a taxonomy object.

Shortcut: gtl

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

Parameters

Name Type(s) Default Value Description
$tax WP_Taxonomy

Taxonomy object.

Returns

object

{ Taxonomy labels object. The first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).

@type string $name                       General name for the taxonomy, usually plural. The same
                                         as and overridden by `$tax->label`. Default 'Tags'/'Categories'.
@type string $singular_name              Name for one object of this taxonomy. Default 'Tag'/'Category'.
@type string $search_items               Default 'Search Tags'/'Search Categories'.
@type string $popular_items              This label is only used for non-hierarchical taxonomies.
                                         Default 'Popular Tags'.
@type string $all_items                  Default 'All Tags'/'All Categories'.
@type string $parent_item                This label is only used for hierarchical taxonomies. Default
                                         'Parent Category'.
@type string $parent_item_colon          The same as `parent_item`, but with colon `:` in the end.
@type string $edit_item                  Default 'Edit Tag'/'Edit Category'.
@type string $view_item                  Default 'View Tag'/'View Category'.
@type string $update_item                Default 'Update Tag'/'Update Category'.
@type string $add_new_item               Default 'Add New Tag'/'Add New Category'.
@type string $new_item_name              Default 'New Tag Name'/'New Category Name'.
@type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default
                                         'Separate tags with commas', used in the meta box.
@type string $add_or_remove_items        This label is only used for non-hierarchical taxonomies. Default
                                         'Add or remove tags', used in the meta box when JavaScript
                                         is disabled.
@type string $choose_from_most_used      This label is only used on non-hierarchical taxonomies. Default
                                         'Choose from the most used tags', used in the meta box.
@type string $not_found                  Default 'No tags found'/'No categories found', used in
                                         the meta box and taxonomy list table.
@type string $no_terms                   Default 'No tags'/'No categories', used in the posts and media
                                         list tables.
@type string $items_list_navigation      Label for the table pagination hidden heading.
@type string $items_list                 Label for the table hidden heading.
@type string $most_used                  Title for the Most Used tab. Default 'Most Used'.
@type string $back_to_items              Label displayed after a term has been updated.

}

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.