Do I have to set parent when set post term?
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). … Read more