Make WordPress Core

Changeset 9743


Ignore:
Timestamp:
11/17/2008 09:43:47 PM (16 years ago)
Author:
markjaquith
Message:

Update update_post_meta() and delete_post_meta() to work with post revisions. Props misterbisson. fixes #7925 for 2.6.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/wp-includes/post.php

    r8825 r9743  
    550550    global $wpdb;
    551551
    552     $post_id = absint( $post_id );
     552    // make sure meta is added to the post, not a revision
     553    if ( $the_post = wp_is_post_revision($post_id) )
     554        $post_id = $the_post;
    553555
    554556    // expected_slashed ($key, $value)
     
    630632function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
    631633    global $wpdb;
     634
     635    // make sure meta is added to the post, not a revision
     636    if ( $the_post = wp_is_post_revision($post_id) )
     637        $post_id = $the_post;
    632638
    633639    // expected_slashed ($meta_key)
Note: See TracChangeset for help on using the changeset viewer.