Opened 15 years ago
Closed 11 years ago
#13347 closed enhancement (worksforme)
Mobile user agent detection for vars.php
Reported by: | mrroundhill | Owned by: | westi |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | |
Focuses: | 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 (8)
#1
@
15 years ago
This should be something for a (core) plugin, becauset there are much more mobile UA.
#2
@
15 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
#3
@
15 years ago
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.
#4
follow-up:
↓ 6
@
14 years ago
- 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.
#5
@
13 years 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