WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r10435 r10150  
    370370    check_admin_referer('media-form');
    371371
    372     if ( isset($_POST['send']) ) {
    373         $keys = array_keys($_POST['send']);
    374         $send_id = (int) array_shift($keys);
    375     }
    376    
    377372    if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
    378373        $post = $_post = get_post($attachment_id, ARRAY_A);
     
    385380        if ( isset($attachment['menu_order']) )
    386381            $post['menu_order'] = $attachment['menu_order'];
    387         if ( isset($send_id) && $attachment_id == $send_id ) {
    388             if ( isset($attachment['post_parent']) )
    389                 $post['post_parent'] = $attachment['post_parent'];
    390         }
     382        if ( isset($attachment['post_parent']) )
     383            $post['post_parent'] = $attachment['post_parent'];
    391384
    392385        $post = apply_filters('attachment_fields_to_save', $post, $attachment);
     
    416409    }
    417410
    418     if ( isset($send_id) ) {
     411    if ( isset($_POST['send']) ) {
     412        $keys = array_keys($_POST['send']);
     413        $send_id = (int) array_shift($keys);
    419414        $attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
    420415        $html = $attachment['post_title'];
Note: See TracChangeset for help on using the changeset viewer.