-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
If I'd like to change the name of tags to for example "keywords" in the admin area/editor it's quite easy to do using the taxonomy_labels_post_tag filter. This works everywhere in both Gutenberg (in the sidebar it say "Keywords" and "Add new keyword") and the admin area except for in the maybe tags panel in the post publish panel where "tags" are hardcoded in two strings.
To reproduce
Steps to reproduce the behavior:
- Add something like the following to a plugin or your themes
functions.php
file.
add_filter(
'taxonomy_labels_post_tag',
function( object $labels ): object {
$singular_name = 'Keyword';
$plural_name = 'Keywords';
return (object) [
'name' => $plural_name,
'singular_name' => $singular_name,
'menu_name' => $plural_name,
'all_items' => "All {$plural_name}",
'new_item_name' => "New {$singular_name} Name",
'add_new_item' => "Add New {$singular_name}",
'edit_item' => "Edit {$singular_name}",
'update_item' => "Update {$singular_name}",
'view_item' => "View {$singular_name}",
'add_or_remove_items' => "Add or remove {$plural_name}",
'search_items' => "Search {$plural_name}",
'not_found' => "No {$plural_name} found",
'no_terms' => "No {$plural_name}",
'items_list' => "{$plural_name} list",
'items_list_navigation' => "{$plural_name} list navigation",
];
}
);
- Create a new post using Gutenberg.
- See that "tags" are changed to "keywords" in the sidebar.
- Don't add any tags/keywords before clicking on publish (and make sure to have the post publish panel activated). See that it says "Add tags" and "Tags help users and search engines..." instead of "Add keywords" etc.
Expected behavior
I'd except the maybe tags panel to use the name of the tags taxonomy from the label called "name".
I realise that this is probably very edge-casey, but happy to try and make a PR if y'all deem it worthwhile. :)
Screenshots
"Keywords" in the sidebar.
"Tags" in the post publish panel (but it says keywords in the input field since that uses the label)
Editor version (please complete the following information):
- WordPress version: 5.5-alpha-47853
- Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? Gutenberg plugin
- If the Gutenberg plugin is installed, which version is it? Master