In WordPress 4.3 and 4.4, additional labels have been made available for custom post types and custom taxonomies. These get passed in via the labels
argument when using register_post_type()
and register_taxonomy()
.
New post type labels in 4.3:
featured_image
– Overrides the “Featured Image” phrase for this post type. See #19257.set_featured_image
– Overrides the “Set featured image” phrase for this post type. See #19257.remove_featured_image
– Overrides the “Remove featured image” phrase for this post type. See #19257.use_featured_image
– Overrides the “Use as featured image” phrase for this post type. See #19257.
New post type labels in 4.4:
archives
– The post type archive label used in nav menus. Default “Post Archives”. See #16075.insert_into_item
– Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). See #33616.uploaded_to_this_item
– Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). See #33616.filter_items_list
– Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. See #32147.items_list_navigation
– Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. See #32147.items_list
– Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. See #32147.
New taxonomy labels in 4.3:
no_terms
– Used when indicating that there are no terms in the given taxonomy associated with an object. Default “No tags”/”No categories”. See #32150.
New taxonomy labels in 4.4:
items_list_navigation
– Screen reader text for the pagination heading on the term listing screen. Default “Tags list navigation”/”Categories list navigation”. See #32147.items_list
– Screen reader text for the items list heading on the term listing screen. Default “Tags list”/”Categories list”. See #32147.
See the documentation for get_post_type_labels()
and get_taxonomy_labels()
for the full list of available labels.
Additional labels for custom post types and custom taxonomies by John Blackbourn was originally posted at https://make.wordpress.org/core/2015/12/11/additional-labels-for-custom-post-types-and-custom-taxonomies/
No comments:
Post a Comment