Make WordPress Core

Changeset 6155


Ignore:
Timestamp:
09/22/2007 04:30:40 PM (16 years ago)
Author:
ryan
Message:

Don't reset parent when updating attachment. Props filosofo and michelwp. fixes #5010

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/upload.js

    r5631 r6155  
    202202            h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />";
    203203            h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
     204            h += "<input type='hidden' name='post_parent' value='" + parseInt(this.postID,10) + "' />";
    204205            h += "<input type='hidden' name='action' id='action-value' value='save' />";
    205206            h += "<input type='hidden' name='ID' value='" + id + "' />";
  • trunk/wp-includes/post.php

    r6121 r6155  
    12731273}
    12741274
    1275 function wp_insert_attachment($object, $file = false, $post_parent = 0) {
     1275function wp_insert_attachment($object, $file = false, $parent = 0) {
    12761276    global $wpdb, $user_ID;
    12771277
     
    12811281
    12821282    $object = wp_parse_args($object, $defaults);
     1283    if ( !empty($parent) )
     1284        $object['post_parent'] = $parent;
     1285
    12831286    $object = sanitize_post($object, 'db');
    12841287
Note: See TracChangeset for help on using the changeset viewer.