WordPress.org

Forums

Dont allow more terms (4 posts)

  1. pbappia
    Member
    Posted 2 years ago #

    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?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

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

  3. pbappia
    Member
    Posted 2 years ago #

    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?

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic