Make WordPress Core

Changeset 6654


Ignore:
Timestamp:
01/25/2008 01:55:21 AM (17 years ago)
Author:
ryan
Message:

Clear post_meta cache upon change. Props nbachiyski. fixes #5718

File:
1 edited

Legend:

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

    r6646 r6654  
    486486        return false;
    487487
    488     $cache = wp_cache_get($post_id, 'post_meta');
    489     if ( ! is_array($cache) )
    490         $cache = array();
    491     // expected_slashed ($meta_key)
    492     $cache[$wpdb->escape($meta_key)][] = $meta_value;
    493 
    494     wp_cache_set($post_id, $cache, 'post_meta');
    495 
    496488    $meta_value = maybe_serialize($meta_value);
    497489
    498490    $wpdb->insert( $wpdb->postmeta, compact( 'post_id', 'meta_key', 'meta_value' ) );
     491
     492    wp_delete_cache($post_id, 'post_meta');
     493
    499494    return true;
    500495}
Note: See TracChangeset for help on using the changeset viewer.