Make WordPress Core


Ignore:
Timestamp:
11/07/2005 09:56:03 PM (19 years ago)
Author:
ryan
Message:

Object caching, round one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r2959 r3011  
    119119    }
    120120
     121    wp_cache_set($cat_ID, get_category($cat_ID), 'category');
     122
    121123    if ($update) {
    122124        do_action('edit_category', $cat_ID);
    123125    } else {
     126        wp_cache_delete('all_category_ids', 'category');
    124127        do_action('create_category', $cat_ID);
    125128        do_action('add_category', $cat_ID);
     
    167170    // TODO: Only set categories to general if they're not in another category already
    168171    $wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'");
     172
     173    wp_cache_delete($cat_ID, 'category');
     174    wp_cache_delete('all_category_ids', 'category');
    169175
    170176    do_action('delete_category', $cat_ID);
     
    234240    $wpdb->query("DELETE FROM $wpdb->users WHERE ID = $id");
    235241
     242    wp_cache_delete($id, 'users');
     243    // TODO: Need to delete username keyed cache object.
     244
    236245    do_action('delete_user', $id);
    237246
Note: See TracChangeset for help on using the changeset viewer.