[wp-trac] [WordPress Trac] #33704: Reduce reliance on wp_is_mobile()
WordPress Trac
noreply at wordpress.org
Mon Sep 18 17:49:10 UTC 2023
#33704: Reduce reliance on wp_is_mobile()
-------------------------------------+-----------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: General | Version: 3.4
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses: ui, javascript
-------------------------------------+-----------------------------
Comment (by westonruter):
> User agent sniffing is bad.
In addition to reducing reliance on `wp_is_mobile()` in core, there is
also a new alternative to `User-Agent` sniffing thanks to Client Hints.
Supporting browsers (currently ~70%) send a `Sec-CH-UA-Mobile` request
header with the value of `?1` when it is a mobile device. I've opened
#59370 to add support for this header in `wp_is_mobile()` as it is more
reliable when present.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33704#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list