#21667 closed enhancement (wontfix)
Add some user agent to wp_is_mobile
Reported by: | inpixelitrust | Owned by: | stevenkword |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4.1 |
Component: | General | Keywords: | dev-feedback has-patch needs-unit-tests |
Focuses: | Cc: |
Description
Hello,
I've run some test with the help of the twitter/G+ community on wp_is_mobile and found some mobile browser that don't pass the test.
You can see the test here : http://www.inpixelitrust.fr/blog/wp_is_mobile/
I was able to get the user agent of 3 of those which don't work :
HTC sensation z710 4.0.3 native browser (UA: Mozilla/5.0 (X11;Linux x86_64; HTC/Sensation/3.32.162.11; fr-de)
AplliWebkit/534.24(KHTML,like Gecko) Chrome/11.0.696.32 Safari/534.34 )
BlackBerry Playbook (Ua Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.0.1; en-US) AplleWebkit/535.8+ (KHTML, like Gecko) Version/7.2.0.1 Safari/535.8+ )
Could be great to add those to the UA sniffing :)
Attachments (1)
Change History (13)
#1
@
12 years ago
- Summary changed from Addd some user agent to wp_is_mobile to Add some user agent to wp_is_mobile
#2
@
12 years ago
- Component changed from Template to Administration
- Type changed from feature request to enhancement
#6
@
9 years ago
- Keywords has-patch added
Now use the detectmobilebrowsers.com regex that is more powerful but is not updated from 2014 but surely is better that the actual solution.
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
#8
@
9 years ago
- Keywords needs-unit-tests added
- Owner set to stevenkword
- Status changed from new to assigned
#9
@
9 years ago
The patch looks reasonable, but a bit more complex.
In general I wouldn't recommend doing UA sniffing. Should we really further encourage a bad practice? Core uses wp_is_mobile()
only in a few places, mostly for historical reasons where touch devices were not considered before.
#10
@
9 years ago
There are many themes that use this function and also plugin.
I know that the patch contain a complex regex but recognize the majority of mobile os.
Maybe we can choose to use a different regex more light.
#11
@
7 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from assigned to closed
Related: #24541