_device_can_upload

Test if the current device has the capability to upload files.

Description

_device_can_upload(); 

Usage

  1. if ( !function_exists( '_device_can_upload' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = _device_can_upload(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.php  
  1. function _device_can_upload() { 
  2. if ( ! wp_is_mobile() ) 
  3. return true; 
  4.  
  5. $ua = $_SERVER['HTTP_USER_AGENT']; 
  6.  
  7. if ( strpos($ua, 'iPhone') !== false 
  8. || strpos($ua, 'iPad') !== false 
  9. || strpos($ua, 'iPod') !== false ) { 
  10. return preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' ); 
  11.  
  12. return true;