Opened 3 years ago
Last modified 23 months ago
#13347 new enhancement
Mobile user agent detection for vars.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | lowest | Milestone: | Future Release |
| Component: | Plugins | Version: | |
| Severity: | minor | Keywords: | |
| Cc: |
Description
We've added some user agent detection for mobile clients in the vars.php file, thought it would be good to have in core for plugins and themes to use. Attaching patched vars.php.
Attachments (2)
Change History (7)
mrroundhill — 3 years ago
This should be something for a (core) plugin, becauset there are much more mobile UA.
comment:2
johnbillion — 3 years ago
- Component changed from Revisions to Plugins
- Keywords vars removed
- Owner set to westi
- Priority changed from normal to low
There's a typo in that patch - $is_pad
I think I'm with ocean90 on this. Also, the patch changes the functionality of $is_iphone, which currently identifies all mobile Safari products, including iPad, iPhone, and the iPod touch. I see no reason to change that, or introduce additional constants when a proper detection script would be dozens more.
- Milestone changed from Awaiting Review to Future Release
- Priority changed from low to lowest
- Severity changed from normal to minor
At most, we should have a single variable that tries to identify popular touch screens, and use that instead of $is_iphone where we use $is_iphone in core. (We use it for hover/display states on action links.) That's it though, I'm thinking.
comment:5
joshuaodmark — 23 months ago
I would highly suggest working in WURFL to perform mobile detection.
It comes with a single XML configuration file which allows it to be updated easily.
It has a cache mechanism that complicates things slightly, but supports the most popular cache mechanisms including a flat file system.
By doing this, it would allow WordPress to provide an object to themes & plugins that will not only detect a mobile device, but it will give advanced details in a standardized format such as screen resolution, brand, model, OS, OS version, and more.

vars with mobile user agent detection