WordPress.org

Make WordPress Core

Changeset 5524


Ignore:
Timestamp:
05/23/2007 07:26:52 AM (14 years ago)
Author:
ryan
Message:

Add some term hooks. see #4189

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r5523 r5524  
    6464        $wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('$term_id', '$taxonomy', '$description', '$parent', '0')");
    6565        $tt_id = (int) $wpdb->insert_id;
     66    }
     67
     68    if ($update) {
     69        do_action("edit_term", $term_id, $tt_id);
     70        do_action("edit_$taxonomy", $term_id, $tt_id);
     71    } else {
     72        do_action("create_term", $term_id, $tt_id);
     73        do_action("create_$taxonomy", $term_id, $tt_id);
     74    }
     75
     76    $term_id = apply_filters('term_id_filter', $term_id, $tt_id, $update);
     77
     78    //clean_term_cache($term_id);
     79
     80    if ($update) {
     81        do_action("edited_term", $term_id, $tt_id);
     82        do_action("edited_$taxonomy", $term_id, $tt_id);
     83    } else {
     84        do_action("created_term", $term_id, $tt_id);
     85        do_action("created_$taxonomy", $term_id, $tt_id);
    6686    }
    6787
Note: See TracChangeset for help on using the changeset viewer.