Make WordPress Core


Ignore:
Timestamp:
09/15/2014 02:23:31 PM (12 years ago)
Author:
SergeyBiryukov
Message:

Make sure the $parent argument of wp_insert_attachment() still works as expected after [28579].

prop jesin, dikiy_forester.
fixes #29646 for trunk.

File:
1 edited

Legend:

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

    r29468 r29745  
    47204720        $defaults = array(
    47214721                'file'        => $file,
    4722                 'post_parent' => $parent
     4722                'post_parent' => 0
    47234723        );
     4724
    47244725        $data = wp_parse_args( $args, $defaults );
     4726
     4727        if ( ! empty( $parent ) ) {
     4728                $data['post_parent'] = $parent;
     4729        }
    47254730
    47264731        $data['post_type'] = 'attachment';
Note: See TracChangeset for help on using the changeset viewer.