[wp-trac] [WordPress Trac] #21181: simplify and add filter to is_upload_space_available

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 9 17:44:44 UTC 2012


#21181: simplify and add filter to is_upload_space_available
-------------------------+------------------------------
 Reporter:  jkudish      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:  3.4.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by dllh):

 21181.patch (replaced the original by accident) includes fixes for other
 places that call {{{get_dirsize()}}}. I started to implement a filter in
 {{{get_dirsize()}}} instead of duplicating filters here but decided that
 wouldn't work, since {{{get_upload_space_available()}}} calls
 {{{get_dirsize()}}} per file if it gets past the new
 {{{pre_get_upload_space_available}}} filter. This would cause
 {{{get_dirsize()}}} to return the filtered version on every call even when
 we wanted to walk the file tree.

 I suppose an alternate approach would be to still filter within
 {{{get_dirsize()}}} and just remove the filter in
 {{{get_upload_space_available()}}}. I'm sticking with the more explicit,
 transparent (if slightly repetitive) solution that calls the
 {{{blog_space_used filter}}} everywhere needed for now.

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


More information about the wp-trac mailing list