Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Looking for a hook like "edit_term_taxonomy" WordPress

Hi,

I'm looking for a hook to lauch a function when someone adds or edit a term in a custom taxonomy.
edit_term_taxonomy works when you edit a term
What about creating a new term ?

Answers (3)

2011-11-16

Utkarsh Kukreti answers:

'create_term' hook.


Utkarsh Kukreti comments:

http://adambrown.info/p/wp_hooks/hook/create_term?version=3.2&file=wp-includes/taxonomy.php


gmajoulet comments:

Doesn't work when I add a new term from the quick add term, on the taxonomy page

2011-11-16

John Cotton answers:

Do you mean so you can add fields to the edit page?

{taxonomy_name}_edit_form_fields

On save edit_term or created_term (depending on whether it's new...) is fired.

2011-11-16

Julio Potier answers:

<strong>"create_$taxonomy"</strong> hook if you use a custom taxo like you said
and
<strong>"created_$taxonomy"</strong> hook, same but AFTER creation.

Here the doc :
<blockquote> * @uses do_action() Calls 'create_term' hook with the term id and taxonomy id as parameters.
* @uses do_action() Calls 'create_$taxonomy' hook with term id and taxonomy id as parameters.
* @uses do_action() Calls 'created_term' hook with the term id and taxonomy id as parameters.
* @uses do_action() Calls 'created_$taxonomy' hook with term id and taxonomy id as parameters. </blockquote>

Hope it helps