Hi I’ve downloaded a plugin “Simple Staff List” and it does what I need but I don’t want editors to create a sub-category. How can I remove/hide the “Parent” selectbox on the form?
Leave a Reply
You must be logged in to post a comment.
Hi I’ve downloaded a plugin “Simple Staff List” and it does what I need but I don’t want editors to create a sub-category. How can I remove/hide the “Parent” selectbox on the form?
You must be logged in to post a comment.
Add bellow code in your current theme
function.php
file.You can use set these options in
register_taxonomy()
funcThis would remove the parent field.
This will remove the parent dropdown from both the taxonomy and post new/edit screens.
If you want to disable “hierarchical” itself from category taxonomy, add this code in your
function.php
.Add bellow code in your current theme function.php file.
Reference: https://codex.wordpress.org/Function_Reference/register_taxonomy
This will work with WordPress 5.4.2. For me all other solutions show the fields as long as jQuery removes them. My quick and dirty solution hides via CSS and remove them with jQuery. Unfortunately only hiding (not removing) seems to work with Gutenberg Editor. Maybe someone else has another solution.
Ah by the way – DON’T use the following code because you get bad issues with it. When you are saving a post without changing category, all categories of this post will be deleted and the category IDs will be created as new categories and added to your post.