mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Store uploads according to the parent post date when using year/month sub-directories
git-svn-id: https://develop.svn.wordpress.org/trunk@9663 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -173,7 +173,11 @@ win.send_to_editor('<?php echo addslashes($html); ?>');
|
||||
*/
|
||||
function media_handle_upload($file_id, $post_id, $post_data = array()) {
|
||||
$overrides = array('test_form'=>false);
|
||||
$file = wp_handle_upload($_FILES[$file_id], $overrides);
|
||||
|
||||
$post = get_post($post_id);
|
||||
$time = $post->post_date_gmt;
|
||||
|
||||
$file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
|
||||
|
||||
if ( isset($file['error']) )
|
||||
return new WP_Error( 'upload_error', $file['error'] );
|
||||
|
||||
Reference in New Issue
Block a user