WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/12/2012 12:16:37 AM (10 years ago)
Author:
azaozz
Message:

Don't hide links to the upload form and show an error for mobile devices that cannot upload, see #20410

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r20440 r20449  
    36773677}
    36783678
     3679/**
     3680 * Test if the current device has the capability to upload files.
     3681 *
     3682 * @since 3.4.0
     3683 * @access private
     3684 *
     3685 * @return bool true|false
     3686 */
     3687function _device_can_upload() {
     3688    if ( ! wp_is_mobile() )
     3689        return true;
     3690
     3691    $ua = $_SERVER['HTTP_USER_AGENT'];
     3692   
     3693    if ( strpos($ua, 'iPhone') !== false
     3694        || strpos($ua, 'iPad') !== false
     3695        || strpos($ua, 'iPod') !== false ) {
     3696            return false;
     3697    } else {
     3698        return true;
     3699    }
     3700}
     3701
Note: See TracChangeset for help on using the changeset viewer.