Make WordPress Core


Ignore:
Timestamp:
11/13/2008 06:22:00 PM (17 years ago)
Author:
azaozz
Message:

Store uploads according to the parent post date when using year/month sub-directories

File:
1 edited

Legend:

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

    r9654 r9663  
    174174function media_handle_upload($file_id, $post_id, $post_data = array()) {
    175175    $overrides = array('test_form'=>false);
    176     $file = wp_handle_upload($_FILES[$file_id], $overrides);
     176   
     177    $post = get_post($post_id);
     178    $time = $post->post_date_gmt;
     179
     180    $file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
    177181
    178182    if ( isset($file['error']) )
Note: See TracChangeset for help on using the changeset viewer.