Make WordPress Core


Ignore:
Timestamp:
12/02/2008 12:32:54 PM (16 years ago)
Author:
azaozz
Message:

Simple iPhone detection, disable hiding of action links for iPhone

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/vars.php

    r8826 r10010  
    3535
    3636// Simple browser detection
    37 $is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = false;
     37$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false;
    3838
    3939if (strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false) {
     
    4141} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'chrome') !== false ) {
    4242    $is_chrome = true;
    43 } elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') !== false ) {
     43} elseif ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false ) {
    4444    $is_safari = true;
    4545} elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false) {
     
    5454    $is_NS4 = true;
    5555}
     56
     57if ( $is_safari && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') !== false )
     58    $is_iphone = true;
    5659
    5760$is_IE = ( $is_macIE || $is_winIE );
Note: See TracChangeset for help on using the changeset viewer.