[wp-trac] Re: [WordPress Trac] #8753: Filter 'upload_dir' is called excessively for (seemingly) no reason

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 30 08:59:57 GMT 2008

#8753: Filter 'upload_dir' is called excessively for (seemingly) no reason
 Reporter:  ulfben                    |        Owner:  anonymous
     Type:  defect (bug)              |       Status:  new      
 Priority:  normal                    |    Milestone:  2.8      
Component:  General                   |      Version:  2.7      
 Severity:  normal                    |   Resolution:           
 Keywords:  dev-feedback needs-patch  |  
Comment (by ulfben):

 I don't want to come off as a complete tool, but it ''is'' confusing me.
 WP <2.7 (it seems) did not run this filter as frequently, and the various
 paths and URLs for uploads are stored in the database either way, right?

 Isn't it completely redundant to run wp_upload_dir() when "reading"?

 Thing is; there's no context to the filter call now. For the vast majority
 of runs in 2.7 my plugin can not return a useful path (no post is being
 worked with, so no dates, author name or other "path variables"
 available). I return the default one as a bailout, and WP seems to run on
 just fine still. So... is it really using these returns for anything?
 (remember - the default upload dir would be kind of useless on a system
 where everything is stored according to Custom Upload Dir-settings - so WP
 must be getting the correct paths from somewhere else).

 I fully embrace the possibility that I'm just misusing the filter or doing
 it wrong™ - but I hope the issue is relevant to more than just my little
 plugin. :)

Ticket URL: <http://trac.wordpress.org/ticket/8753#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list