I'm looking for a hook that fires whenever a new term is added to a custom taxonomy.
I tried set_object_terms
and create_category
but I can't get them to work it seems.
I need a hook that will fire whenever someone adds a term when creating a new Post.
I'm looking for a hook that fires whenever a new term is added to a custom taxonomy.
I tried set_object_terms
and create_category
but I can't get them to work it seems.
I need a hook that will fire whenever someone adds a term when creating a new Post.
Share Improve this question asked May 6, 2019 at 17:04 RichardRichard 1616 bronze badges1 Answer
Reset to default 3create_category
runs when a new category is created, in turn set_object_terms
fires after a terms have been set to object.
The hooks you are looking for are:
- create_{$taxonomy} - new term in a specific taxonomy is created
- created_{$taxonomy} - new term created, term cache has been cleaned
- create_term
- created_term
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745518729a4631159.html
评论列表(0条)