How perform action during add/edit/delete category using hooks : wordpress

Hello Friends!!
If you want perform any action during add/edit/delete category/taxonomy without changing in wordpress core files then you can do it using wordpress hooks . You will only need to add given blow function in your theme function file, no need to edit

/** Call function during create new category/taxonomy */
function wp_custom_save_taxonomy($term_id) {
print_r($_POST); // add action here
/** Call function during edit category/taxonomy */
function wp_custom_edit_taxonomy($term_id) {
print_r($_POST); // add action here
/** Call function during delete category/taxonomy */
function wp_custom_delete_taxonomy($term_taxonomy_id) {
       global $wpdb; // add action here

I hope you will enjoy wordpress hooks magic!!

Leave a Reply

Your email address will not be published. Required fields are marked *