Introduce wp_is_mobile() and use it instead of $is_iphone global, see #20014

git-svn-id: https://develop.svn.wordpress.org/trunk@20417 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2012-04-10 01:19:30 +00:00
parent fdce6271d0
commit bce0d37a67
11 changed files with 87 additions and 59 deletions

View File

@@ -583,9 +583,10 @@ foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
}
function _ipad_meta() {
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false ) { ?>
<meta name="viewport" id="ipad-viewportmeta" content="width=device-width, initial-scale=1">
<?php
if ( wp_is_mobile() ) {
?>
<meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1">
<?php
}
}
add_action('admin_head', '_ipad_meta');