Consistently remove links to media-new.php for mobile devices, props SergeyBiryukov, see #20405

git-svn-id: http://svn.automattic.com/wordpress/trunk@20422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-04-10 03:18:48 +00:00
parent 02d0a5173a
commit 5de5c9a64d
3 changed files with 8 additions and 3 deletions

View File

@ -106,7 +106,7 @@ case 'edit' :
<h2> <h2>
<?php <?php
echo esc_html( $title ); echo esc_html( $title );
if ( current_user_can( 'upload_files' ) ) { ?> if ( current_user_can( 'upload_files' ) && ! wp_is_mobile() ) { ?>
<a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a>
<?php } ?> <?php } ?>
</h2> </h2>

View File

@ -176,7 +176,12 @@ require_once('./admin-header.php');
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php <h2>
<?php
echo esc_html( $title );
if ( current_user_can( 'upload_files' ) && ! wp_is_mobile() ) { ?>
<a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
}
if ( ! empty( $_REQUEST['s'] ) ) if ( ! empty( $_REQUEST['s'] ) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
</h2> </h2>

View File

@ -489,7 +489,7 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
unset( $cpts['post'] ); unset( $cpts['post'] );
} }
if ( current_user_can( 'upload_files' ) ) if ( current_user_can( 'upload_files' ) && ! wp_is_mobile() )
$actions[ 'media-new.php' ] = array( _x( 'Media', 'add new from admin bar' ), 'new-media' ); $actions[ 'media-new.php' ] = array( _x( 'Media', 'add new from admin bar' ), 'new-media' );
if ( current_user_can( 'manage_links' ) ) if ( current_user_can( 'manage_links' ) )