WordPress.org

Make WordPress Core

Ticket #22774: 22774.diff

File 22774.diff, 642 bytes (added by nacin, 17 months ago)
  • wp-admin/includes/post.php

     
    235235                        } 
    236236                } 
    237237 
    238                 if ( isset( $post_data['attachments'][ $post_ID ] ) ) 
    239                         $post_data = apply_filters( 'attachment_fields_to_save', $post_data, $post_data['attachments'][ $post_ID ] ); 
     238                $attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array(); 
     239                $post_data = apply_filters( 'attachment_fields_to_save', $post_data, $attachment_data ); 
    240240        } 
    241241 
    242242        add_meta( $post_ID );