Builds an object with all taxonomy labels out of a taxonomy object.
Parameters
$taxWP_Taxonomy
Taxonomy object.
Return
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).
$namestring
General name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default 'Tags'/'Categories'.
$singular_namestring
Name for one object of this taxonomy. Default 'Tag'/'Category'.
$search_itemsstring
Default 'Search Tags'/'Search Categories'.
$popular_itemsstring
This label is only used for non-hierarchical taxonomies. Default 'Popular Tags'.
$all_itemsstring
Default 'All Tags'/'All Categories'.
$parent_itemstring
This label is only used for hierarchical taxonomies. Default 'Parent Category'.
$parent_item_colonstring
The same as parent_item, but with colon : in the end.
$name_field_descriptionstring
Description for the Name field on Edit Tags screen. Default 'The name is how it appears on your site'.
$slug_field_descriptionstring
Description for the Slug field on Edit Tags screen. Default 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens'.
$parent_field_descriptionstring
Description for the Parent field on Edit Tags screen. Default 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band'.
$desc_field_descriptionstring
Description for the Description field on Edit Tags screen. Default 'The description is not prominent by default; however, some themes may show it'.
$edit_itemstring
Default 'Edit Tag'/'Edit Category'.
$view_itemstring
Default 'View Tag'/'View Category'.
$update_itemstring
Default 'Update Tag'/'Update Category'.
$add_new_itemstring
Default 'Add Tag'/'Add Category'.
$new_item_namestring
Default 'New Tag Name'/'New Category Name'.
$template_namestring
Default 'Tag Archives'/'Category Archives'.
$separate_items_with_commasstring
This label is only used for non-hierarchical taxonomies. Default 'Separate tags with commas', used in the meta box.
$add_or_remove_itemsstring
This label is only used for non-hierarchical taxonomies. Default 'Add or remove tags', used in the meta box when JavaScript is disabled.
$choose_from_most_usedstring
This label is only used on non-hierarchical taxonomies. Default 'Choose from the most used tags', used in the meta box.
$not_foundstring
Default 'No tags found'/'No categories found', used in the meta box and taxonomy list table.
$no_termsstring
Default 'No tags'/'No categories', used in the posts and media list tables.
$filter_by_itemstring
This label is only used for hierarchical taxonomies. Default 'Filter by category', used in the posts list table.
$items_list_navigationstring
Label for the table pagination hidden heading.
$items_liststring
Label for the table hidden heading.
$most_usedstring
Title for the Most Used tab. Default 'Most Used'.
$back_to_itemsstring
Label displayed after a term has been updated.
$item_linkstring
Used in the block editor. Title for a navigation link block variation. Default 'Tag Link'/'Category Link'.
$item_link_descriptionstring
Used in the block editor. Description for a navigation link block variation. Default 'A link to a tag'/'A link to a category'.
Hooks fired · 1
One hook fires while get_taxonomy_labels() runs, in this order:
707functionget_taxonomy_labels($tax){708$tax->labels=(array)$tax->labels;709710if(isset($tax->helps)&&empty($tax->labels['separate_items_with_commas'])){711$tax->labels['separate_items_with_commas']=$tax->helps;712}713714if(isset($tax->no_tagcloud)&&empty($tax->labels['not_found'])){715$tax->labels['not_found']=$tax->no_tagcloud;716}717718$nohier_vs_hier_defaults=WP_Taxonomy::get_default_labels();719720$nohier_vs_hier_defaults['menu_name']=$nohier_vs_hier_defaults['name'];721722$labels=_get_custom_object_labels($tax,$nohier_vs_hier_defaults);723724if(!isset($tax->labels->template_name)&&isset($labels->singular_name)){725/* translators: %s: Taxonomy name. */726$labels->template_name=sprintf(_x('%s Archives','taxonomy template name'),$labels->singular_name);727}728729$taxonomy=$tax->name;730731$default_labels=clone$labels;732733/**734 * Filters the labels of a specific taxonomy.735 *736 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.737 *738 * Possible hook names include:739 *740 * - `taxonomy_labels_category`741 * - `taxonomy_labels_post_tag`742 *743 * @since 4.4.0744 *745 * @see get_taxonomy_labels() for the full list of taxonomy labels.746 *747 * @param object $labels Object with labels for the taxonomy as member variables.748 */749$labels=apply_filters("taxonomy_labels_{$taxonomy}",$labels);750751// Ensure that the filtered labels contain all required default values.752$labels=(object)array_merge((array)$default_labels,(array)$labels);753754return$labels;755}
History
Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.6.0
Added the template_name label.from the docblock
5.9.0
Added the name_field_description, slug_field_description, parent_field_description, and desc_field_description labels.from the docblock
5.8.0
Added the item_link and item_link_description labels.from the docblock
5.7.0
Added the filter_by_item label.from the docblock
4.9.0
Added the most_used and back_to_items labels.from the docblock
4.4.0
Added the items_list_navigation and items_list labels.from the docblock
4.3.0
Added the no_terms label.from the docblock
3.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/taxonomy.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.