diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 2bb211ea36..907041e21d 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -155,6 +155,10 @@ function get_temp_dir() { if ( function_exists('sys_get_temp_dir') ) return trailingslashit(sys_get_temp_dir()); + + $temp = ini_get('upload_tmp_dir'); + if ( is_dir($temp) ) // always writable + return trailingslashit($temp); return '/tmp/'; }