[wp-trac] [WordPress Trac] #20410: Introduce a function to detect a device's ability to upload files

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 10 16:51:47 UTC 2012


#20410: Introduce a function to detect a device's ability to upload files
-------------------------+-----------------------------
 Reporter:  johnbillion  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 Precursors: #20100 and #20405.

 Some browser/OS combos don't allow files to be uploaded. The most common
 of these is Mobile Safari on iOS.

 We should introduce a function which tells us if a given device is capable
 of uploading files. We can then use it in place of some of the
 `wp_is_mobile()` calls (which were introduced in [20417] to replace the
 `$is_iphone` global) where we need to hide certain UI elements relating to
 file uploads.

 I propose a conditional function such as `device_can_upload()` that
 defaults to a return value of `true` but returns `false` for known
 browser/OS/device combos that can't upload files. Browser sniffing is bad
 of course, but there's no other way to do it.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20410>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list