Changeset 20449
- Timestamp:
- 04/12/2012 12:16:37 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r20417 r20449 65 65 global $redir_tab; 66 66 $tabs = media_upload_tabs(); 67 68 if ( wp_is_mobile() ) { 69 unset($tabs['type']); 70 $default = 'type_url'; 71 } else { 72 $default = 'type'; 73 } 67 $default = 'type'; 74 68 75 69 if ( !empty($tabs) ) { … … 599 593 } 600 594 601 if ( wp_is_mobile() ) 602 return wp_iframe( 'media_upload_type_url_form', 'image', $errors, $id ); 603 else 604 return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); 595 return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); 605 596 } 606 597 … … 1307 1298 global $type, $tab, $pagenow, $is_IE, $is_opera; 1308 1299 1309 if ( wp_is_mobile() ) 1300 if ( ! _device_can_upload() ) { 1301 echo '<p>' . __('The web browser on your device cannot be used to upload files. You may be able to use the <a href=" http://wordpress.org/extend/mobile/">native app for your device</a> instead.') . '</p>'; 1310 1302 return; 1303 } 1311 1304 1312 1305 $upload_action_url = admin_url('async-upload.php'); … … 1439 1432 */ 1440 1433 function media_upload_type_form($type = 'file', $errors = null, $id = null) { 1441 if ( wp_is_mobile() )1442 return;1443 1434 1444 1435 media_upload_header(); -
trunk/wp-admin/media-new.php
r20420 r20449 10 10 /** Administration bootstrap */ 11 11 require_once('./admin.php'); 12 13 if ( wp_is_mobile() ) // cannot upload files from mobile devices14 return;15 16 12 require_once('./media-upload.php'); -
trunk/wp-admin/media.php
r20422 r20449 107 107 <?php 108 108 echo esc_html( $title ); 109 if ( current_user_can( 'upload_files' ) && ! wp_is_mobile()) { ?>109 if ( current_user_can( 'upload_files' ) ) { ?> 110 110 <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> 111 111 <?php } ?> -
trunk/wp-admin/menu.php
r20417 r20449 57 57 $submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php'); 58 58 /* translators: add new file */ 59 if ( ! wp_is_mobile() ) 60 $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php'); 59 $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php'); 61 60 62 61 $menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'div' ); -
trunk/wp-admin/upload.php
r20422 r20449 180 180 <?php 181 181 echo esc_html( $title ); 182 if ( current_user_can( 'upload_files' ) && ! wp_is_mobile()) { ?>182 if ( current_user_can( 'upload_files' ) ) { ?> 183 183 <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a><?php 184 184 } -
trunk/wp-includes/admin-bar.php
r20422 r20449 490 490 } 491 491 492 if ( current_user_can( 'upload_files' ) && ! wp_is_mobile())492 if ( current_user_can( 'upload_files' ) ) 493 493 $actions[ 'media-new.php' ] = array( _x( 'Media', 'add new from admin bar' ), 'new-media' ); 494 494 -
trunk/wp-includes/functions.php
r20440 r20449 3677 3677 } 3678 3678 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 */ 3687 function _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.