Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #20014, comment 4


Ignore:
Timestamp:
05/13/2019 10:37:08 AM (7 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20014, comment 4

    v1 v2  
    11Pursuant to the discussion with Azaozz and Nacin on 2/18 in #wordpress-ui here's my quick draft on a cookie-based detection of touch interfaces ...
    22
    3 `
    4 
     3{{{
    54function wp_check_for_touch_ui(){
    65        if( isset( $_COOKIE['wp_ui_touch'] ) && ( 'true' == $_COOKIE['wp_ui_touch'] ) ) return;
     
    2423// this will catch future touch events if they somehow make it past the login page without touching ...
    2524add_action( 'admin_footer', 'wp_check_for_touch_ui' );
    26 
    27 `
     25}}}
    2826
    2927It'll normally trigger on  the login page, setting the cookie to be tested against either directly or via a function or whatever y'all think is best, for including the additional JS and such to make drag/drop and other features work on touch-based interfaces.