WordPress.org

Make WordPress Core

Ticket #11397: 11397.diff

File 11397.diff, 1.2 KB (added by Denis-de-Bernardy, 8 years ago)
  • wp-admin/includes/post.php

     
    599599        $mid = (int) $mid;
    600600
    601601        $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
    602         wp_cache_delete($post_id, 'post_meta');
    603602
    604603        do_action( 'delete_postmeta', $mid );
     604        wp_cache_delete($post_id, 'post_meta');
    605605        $rval = $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
    606606        do_action( 'deleted_postmeta', $mid );
    607607
     
    686686                return false;
    687687
    688688        $post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) );
    689         wp_cache_delete($post_id, 'post_meta');
    690689
    691690        $meta_value = maybe_serialize( stripslashes_deep( $meta_value ) );
    692691        $meta_id = (int) $meta_id;
     
    696695
    697696        do_action( 'update_postmeta', $meta_id, $post_id, $meta_key, $meta_value );
    698697        $rval = $wpdb->update( $wpdb->postmeta, $data, $where );
     698        wp_cache_delete($post_id, 'post_meta');
    699699        do_action( 'updated_postmeta', $meta_id, $post_id, $meta_key, $meta_value );
    700700
    701701        return $rval;