WordPress开发者和主题制作者的搜索引擎



_device_can_upload ›

Since3.4.0
已弃用n/a
_device_can_upload ( 没有参数 )
访问:
  • private
返回:
  • (bool) Whether the device is able to upload files.
定义在:
文档:

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



源码

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 preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' );
	}

	return true;
}