[wp-trac] [WordPress Trac] #10559: Allow a custom subdir in wp_upload_dir

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 6 20:09:49 UTC 2009


#10559: Allow a custom subdir in wp_upload_dir
-------------------------------------+--------------------------------------
 Reporter:  aaroncampbell            |        Type:  enhancement
   Status:  new                      |    Priority:  normal     
Milestone:  2.9                      |   Component:  Upload     
  Version:                           |    Severity:  normal     
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------

Comment(by Denis-de-Bernardy):

 Replying to [comment:3 aaroncampbell]:
 > Not all uploads have a post.
 >
 > Also, the second patch was just to add the documentation.  I meant to
 have it overwrite the first upload...oops.

 in this case, you don't need the patch at all.

 {{{
 add_filter('upload_dir', 'foobar');
 $dir = upload_dir()l
 remove_filter('upload_dir', 'foobar');
 }}}

 and have foobar() amend the dir as needed. what's desperately needed in
 that function is a post_id argument; not a subdir argument.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10559#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list