mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-24 07:14:28 +00:00
Don't hide links to the upload form and show an error for mobile devices that cannot upload, see #20410
git-svn-id: https://develop.svn.wordpress.org/trunk@20449 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3676,3 +3676,26 @@ function _get_non_cached_ids( $object_ids, $cache_key ) {
|
||||
return $clean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if the current device has the capability to upload files.
|
||||
*
|
||||
* @since 3.4.0
|
||||
* @access private
|
||||
*
|
||||
* @return bool true|false
|
||||
*/
|
||||
function _device_can_upload() {
|
||||
if ( ! wp_is_mobile() )
|
||||
return true;
|
||||
|
||||
$ua = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
if ( strpos($ua, 'iPhone') !== false
|
||||
|| strpos($ua, 'iPad') !== false
|
||||
|| strpos($ua, 'iPod') !== false ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user