Do I have to set parent when set post term?

When save a term which is a child term, if I don’t provide specific parent id, will WP make this term’s parent 0 ?

Related posts

Leave a Reply

1 comment

  1. When you create a term for a hierarchical taxonomy, if you don’t specify a parent, its parent ID is set to 0. In other words, it becomes a parent term.


    Edited with regards to comments:

    • Add specifically each term you wish to add to the post (parent terms aren’t automatically added if their children are).
    • Adding terms to posts does not effect the terms relationship with each other (i.e.. child-parent relationship remains in tact).