mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Fix uploads sub-directory for drafts, props DD32, fixes #8205
git-svn-id: http://svn.automattic.com/wordpress/trunk@9675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6adb94fd45
commit
d87ff92c67
@ -173,9 +173,12 @@ win.send_to_editor('<?php echo addslashes($html); ?>');
|
|||||||
*/
|
*/
|
||||||
function media_handle_upload($file_id, $post_id, $post_data = array()) {
|
function media_handle_upload($file_id, $post_id, $post_data = array()) {
|
||||||
$overrides = array('test_form'=>false);
|
$overrides = array('test_form'=>false);
|
||||||
|
|
||||||
$post = get_post($post_id);
|
$time = current_time('mysql', true);
|
||||||
$time = $post->post_date_gmt;
|
if ( $post = get_post($post_id) ) {
|
||||||
|
if ( substr( $post->post_date, 0, 4 ) > 0 )
|
||||||
|
$time = $post->post_date;
|
||||||
|
}
|
||||||
|
|
||||||
$file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
|
$file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user