Title: Mobile Detector
Author: Tubal
Published: <strong>2011년 12월 12일</strong>
Last modified: 2012년 12월 21일

---

플러그인 검색

이 플러그인은 **최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다**. 워드프레스의
좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 
있을 수 있습니다.

![](https://s.w.org/plugins/geopattern-icon/mobile-detector.svg)

# Mobile Detector

 작성자: [Tubal](https://profiles.wordpress.org/tubal/)

[다운로드](https://downloads.wordpress.org/plugin/mobile-detector.2.0.2.zip)

 * [세부사항](https://ko.wordpress.org/plugins/mobile-detector/#description)
 * [평가](https://ko.wordpress.org/plugins/mobile-detector/#reviews)
 *  [설치](https://ko.wordpress.org/plugins/mobile-detector/#installation)
 * [개발](https://ko.wordpress.org/plugins/mobile-detector/#developers)

 [지원](https://wordpress.org/support/plugin/mobile-detector/)

## 설명

A lightweight detector of mobile devices, OSs & browsers that, optionally, allows
your site to switch to a mobile theme when a mobile device is detected or when your
users feel like it.

This plugin adds the class **MobileDTS** to WordPress.

#### Mobile Detection

On every request, this plugin will try to detect if the user is viewing your site
with a mobile device or not. If he is, the detector will also give you some info
about the device, browser and OS used.

**Who will be happy with this detector?**

If you need a fast and reliable way to detect if a user is visiting your site with
a mobile device, then you’ll be happy. However, if you need precise information 
about the device used (other than OS and browser) such as screen resolution you 
need a detector such as [DeviceAtlas](http://deviceatlas.com/) or [WURFL](http://wurfl.sourceforge.net/).

**How to query the detector?**

Use the method `MobileDTS::is($key)`. `is()` returns boolean `true` or `false`.

Example:

    ```
    <?php

    if (MobileDTS::is('android')) {
        // User with a mobile device running Android OS
    } else if (MobileDTS::is('ios')) {
        // User with a mobile device running iOS
    } else if (MobileDTS::is('mobile')) {
        // User with a mobile device (any, even 10 years old mobile phones) 
    } else {
        // User with a desktop device   
    }

    ?>
    ```

**Available keys:**

 * `mobile` (Is it a mobile?)
 * `other` (Any other mobile device)

Popular mobile devices

 * `iphone` (Apple iPhone)
 * `ipad` (Apple iPad)
 * `kindle` (Amazon Kindle)

Mobile OS

 * `android` (Android OS)
 * `bada` (Bada OS)
 * `bbos` (Blackberry OS)
 * `ios` (Apple iOS)
 * `palmos` (Palm OS)
 * `symbian` (Symbian OS)
 * `webos` (Hp WebOS)
 * `windows` (Windows Phone OS and older)

Mobile browsers

 * `ff_mobile` (Mozilla Fennec & Firefox mobile)
 * `ie_mobile` (IE mobile)
 * `netfront` (NetFront)
 * `opera_mobile` (Opera Mobile or Mini)
 * `uc_browser` (UC Browser)
 * `webkit_mobile` (Webkit mobile)

#### Theme Switching

You can configure your site to automatically switch to a mobile theme when a mobile
device is detected or when the user requests it (on demand).

Once the plugin is installed, a new submenu titled `Mobile Detector` is added under
the `Settings` menu.

Theme switching is disabled by default. To enable theme switching simply select 
a theme to use as your mobile theme and the plugin will take care of the rest.

This plugin assumes your active theme is optimized for desktop screens only. So,
if you’re using a responsive theme that adapts to any screen size you shouldn’t 
use the theme switching feature (don’t select a theme).

**How it works:**

 * On each page load, this plugin checks for the existence of a cookie that stores
   which theme (mobile-optimized or desktop-optimized) the user prefers to browse.
 * If the cookie exists, the theme the user expects will be displayed.
 * If the cookie does not exist (first-time visitor), this plugin checks whether
   the user is visiting your site with a mobile device or not and, if he is, your
   mobile-optimized theme will be used. Afterwards, a cookie will be set to store
   the user’s “initial preference”.
 * Anytime the user switches (you must create a link/button in your theme using 
   the Template functions below) between themes, the cookie is updated with his 
   preference so the site version (theme) the user expects will be displayed on 
   future visits.

**Template functions**

 * `MobileDTS::get_switch_theme_link()` Returns the current URL with an additional`
   switch_theme` parameter (set automatically to ‘mobile’ or ‘desktop’). You’ll 
   need this function to create a link/button that allows users to switch between
   the desktop and mobile themes. See example below.
 * `MobileDTS::switch_theme_link()`: same as above but this one outputs the URL 
   instead of returning it. URL is escaped.
 * `MobileDTS::get_switch_theme_name()` returns the type of the theme to switch 
   to (either ‘mobile’ or ‘desktop’). Use this method together with `get_switch_theme_link()`.
   The type can be translated to your language (plugin uses wp’s `__()` function
   for ‘mobile’ & ‘desktop’ strings).
 * `MobileDTS::switch_theme_name()` same as above but this one outputs the type 
   instead of returning it.
 * `MobileDTS::is_mobile_theme()` tells you wether your site is displaying to the
   user the mobile theme or not. Returns boolean `true` or `false`.
 * `MobileDTS::is_switcher_enabled()` tells you wether theme switching is disabled
   or not. Returns boolean `true` or `false`.

**Creating a ‘Switch to …’ link**

Let’s create a switch link to allow the user to switch between the 2 versions of
a site (themes):

    ```
    <?php if (MobileDTS::is_switcher_enabled()): // Optional but useful if you need to disable theme switching for a while. ?>

    <a href="<?php MobileDTS::switch_theme_link() ?>">Switch to the <?php MobileDTS::switch_theme_name() ?> version of this site</a>

    <?php endif; ?>
    ```

Paste that code in your templates (usually in `header.php` and/or `footer.php`),
enable theme switching and play a little.

Let’s suppose a user is viewing the site (http://example.com/home) for the first
time with a mobile device and theme switching is enabled. The above code would output
this link:

    ```
    <a href="http://example.com/home?switch_theme=desktop">Switch to the desktop version of this site</a>
    ```

## 스크린샷

[⌊Theme switching settings page. Select a mobile theme or disable theme switching.⌉⌊
Theme switching settings page. Select a mobile theme or disable theme switching.⌉[

Theme switching settings page. Select a mobile theme or disable theme switching.

## 설치

 1. Upload `mobile-detector` folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Done!

## 후기

![](https://secure.gravatar.com/avatar/389e1a46cb862edd2ce6cc820fcf7350fa1a99d0f1cca984d403b425080e844d?
s=60&d=retro&r=g)

### 󠀁[Nice and Simple](https://wordpress.org/support/topic/nice-and-simple-142/)󠁿

 [Adam Pery](https://profiles.wordpress.org/adam1920/) 2017년 2월 7일

Like it

 [ 모든 4 평가 읽기 ](https://wordpress.org/support/plugin/mobile-detector/reviews/)

## 기여자 & 개발자

“Mobile Detector”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에
기여하였습니다.

기여자

 *   [ Tubal ](https://profiles.wordpress.org/tubal/)

[자국어로 “Mobile Detector”(을)를 번역하세요.](https://translate.wordpress.org/projects/wp-plugins/mobile-detector)

### 개발에 관심이 있으십니까?

[코드 탐색하기](https://plugins.trac.wordpress.org/browser/mobile-detector/)는, 
[SVN 저장소](https://plugins.svn.wordpress.org/mobile-detector/)를 확인하시거나,
[개발 기록](https://plugins.trac.wordpress.org/log/mobile-detector/)을 [RSS](https://plugins.trac.wordpress.org/log/mobile-detector/?limit=100&mode=stop_on_copy&format=rss)
로 구독하세요.

## 변경이력

#### 2.0.2

 * The cookie now has both `path` & `domain` set as per WordPress documentation (
   COOKIEPATH & COOKIE_DOMAIN constants) to avoid some rare cases.
 * Memory footprint reduced since admin related code is from now on in a different
   file.
 * New template function added: `is_switcher_enabled()`.

#### 2.0.1

 * Small bugfix regarding mobile detection.

#### 2.0

 * Complete rewrite. New API.
 * Improved & updated mobile detection engine.
 * Added theme switching.

#### 1.1

 * Code refactored. Cleaner to extend if you need to.
 * Removed `$is_other_os` & `$is_other_browser`.

#### 1.0

 * Initial release.

## 기초

 *  버전 **2.0.2**
 *  최근 업데이트: **14년 전**
 *  활성화된 설치 **200+**
 *  워드프레스 버전 ** 3.0 또는 그 이상 **
 *  다음까지 시험됨: **3.5.2**
 *  언어
 * [English (US)](https://wordpress.org/plugins/mobile-detector/)
 * 태그:
 * [detector](https://ko.wordpress.org/plugins/tags/detector/)[device](https://ko.wordpress.org/plugins/tags/device/)
   [mobile](https://ko.wordpress.org/plugins/tags/mobile/)[switcher](https://ko.wordpress.org/plugins/tags/switcher/)
   [theme](https://ko.wordpress.org/plugins/tags/theme/)
 *  [고급 보기](https://ko.wordpress.org/plugins/mobile-detector/advanced/)

## 평점

 별 5점 만점에 5점.

 *  [  4/5-별점 후기     ](https://wordpress.org/support/plugin/mobile-detector/reviews/?filter=5)
 *  [  0/4-별점 후기     ](https://wordpress.org/support/plugin/mobile-detector/reviews/?filter=4)
 *  [  0/3-별점 후기     ](https://wordpress.org/support/plugin/mobile-detector/reviews/?filter=3)
 *  [  0/2-별점 후기     ](https://wordpress.org/support/plugin/mobile-detector/reviews/?filter=2)
 *  [  0/1-별점 후기     ](https://wordpress.org/support/plugin/mobile-detector/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/mobile-detector/reviews/#new-post)

[모든  리뷰 보기](https://wordpress.org/support/plugin/mobile-detector/reviews/)

## 기여자

 *   [ Tubal ](https://profiles.wordpress.org/tubal/)

## 지원

할 말 있으신가요? 도움이 필요하신가요?

 [지원 포럼 보기](https://wordpress.org/support/plugin/mobile-detector/)