Simple iPhone detection, disable hiding of action links for iPhone

git-svn-id: http://svn.automattic.com/wordpress/trunk@10010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-12-02 12:32:54 +00:00
parent 3fa2427f0a
commit 6112842855
2 changed files with 9 additions and 3 deletions

View File

@ -71,9 +71,12 @@ do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');
?>
if ( $is_iphone ) { ?>
<style type="text/css">.row-actions{visibility:visible;}</style>
<?php } ?>
</head>
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
<div id="wpwrap">
<div id="wpcontent">
<div id="wphead">

View File

@ -34,13 +34,13 @@ if ( is_admin() ) {
}
// Simple browser detection
$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = false;
$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
$is_lynx = true;
} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
$is_chrome = true;
} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') !== false ) {
} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) {
$is_safari = true;
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) {
$is_gecko = true;
@ -54,6 +54,9 @@ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
$is_NS4 = true;
}
if ( $is_safari && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') !== false )
$is_iphone = true;
$is_IE = ( $is_macIE || $is_winIE );
// Server detection