Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Trying to make a system whereby a function is called upon an admin changing the taxonomy category (term - if i understand correcrtly) of a custom post type.

I thought the action tag "edit_category" would do this, but doesnt seem to work:

add_action('edit_category_form', 'myFunction');

Any ideas?

Thanks!

share|improve this question

1 Answer 1

'set_object_terms' is probably the hook you want. It gets passed the following: post_id, terms, term_taxonomy ids, taxonomy, append, old term_taxonomy ids.

You can use the post_id and taxonomy params to determine if its the post type and taxonomy you want to hook into, and then check if term_taxonomy_ids differs from the old term_taxonomy_ids to decide whether anything was changed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.