Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.