[英]How to remove button Add New Category (editor-post-taxonomies) in post editor
Add New Category - how to remove this link?添加新类别- 如何删除此链接?
When creating a taxonomy, I use the default_term
argument, so I no longer need the functionality to create and edit taxonomies, I only need the ability to select from those taxonomies that I created using default_term
.创建分类法时,我使用default_term
参数,因此我不再需要创建和编辑分类法的功能,我只需要从我使用default_term
创建的分类法中 select 的能力。
Removed from the menu - show_in_menu
set to false .从菜单中删除 - show_in_menu
设置为false 。 But I don't understand how to remove this link when creating a taxonomy?但我不明白在创建分类时如何删除此链接?
Help remove the ability to edit in the post editor.帮助删除在帖子编辑器中进行编辑的能力。
The following CSS selector can be used to target and hide the "Add New Category" button:以下 CSS 选择器可用于定位和隐藏“添加新类别”按钮:
.components-button.editor-post-taxonomies__hierarchical-terms-add{
display: none;
}
It's also possible to create your own Custom Taxonomy Selector component to replace the existing UI using JavaScript;也可以使用 JavaScript 创建您自己的自定义分类选择器组件来替换现有的 UI; as you need only to hide the button, I would use CSS in this case.因为你只需要隐藏按钮,在这种情况下我会使用 CSS 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.