WordPress.org

Support

Support » How-To and Troubleshooting » Dont allow more terms

Dont allow more terms

  • Hello there.

    I’m wondering if there is a way to stop allowing more children to a parent category.

    My hierarchy looks like this.

    Parent
    Child
    Grandchild
    Grandchild
    Grandchild
    Child
    Grandchild
    Grandchild

    I want it to be possible to add more Grandchildren but no more children in that parent.

    Is it possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi
    Forum Moderator

    @esmi

    Not that I’m aware of. Are you trying to limit the capabilities of specific users, by any chance?

    Yes, problem is that I still want the users to be able to add categories of their own just dont if they try to add a category in the “special” parent.

    I found a solution with adding a few lines in the core files. But that means that I have to add this solution with every update :(.

    Hoping for something better.

    Perhaps there esxist a hook sort of like “before_create_term” or something?

    esmi
    Forum Moderator

    @esmi

    It might be possible to do this via a custom plugin that takes into account the user id and the parent category but, off the top of my head, I’m not sure how to achieve it. Try posting in the Hacks forum to see if they can come up with a starting point for you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dont allow more terms’ is closed to new replies.