Make WordPress Core

Ticket #1481: categories_1.5.1.2_mp001_newhook.patch

File categories_1.5.1.2_mp001_newhook.patch, 891 bytes (added by pejve, 21 years ago)
  • categories.php

    old new  
    3434        $cat = intval($_POST['cat']);
    3535       
    3636        $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$cat')");
     37        do_action('add_category', $wpdb->insert_id);
    3738       
    3839        header('Location: categories.php?message=1#addcat');
    3940break;
     
    5758        $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$cat_parent' WHERE category_parent = '$cat_ID'");
    5859        // TODO: Only set categories to general if they're not in another category already
    5960        $wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'");
     61        do_action('delete_category', $cat_ID);
    6062
    6163        header('Location: categories.php?message=2');
    6264