wp_super_cache_maybe_disable_wptouch()
disable mobile checking if.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wp_super_cache_maybe_disable_wptouch( $t );
- $t(обязательный)
- .
Код wp_super_cache_maybe_disable_wptouch() wp super cache maybe disable wptouch WPSCache 3.1.1
function wp_super_cache_maybe_disable_wptouch( $t ) {
global $cache_wptouch, $wptouch_exclude_ua;
if ( '1' !== $cache_wptouch ) {
return false;
}
if ( ( isset( $_COOKIE['wptouch_switch_toggle'] ) && 'normal' === $_COOKIE['wptouch_switch_toggle'] ) ||
( isset( $_COOKIE['wptouch-pro-view'] ) && 'desktop' === $_COOKIE['wptouch-pro-view'] ) ) {
return true;
}
$ua = explode( ',', $wptouch_exclude_ua );
foreach ( $ua as $agent ) {
if ( preg_match( "#$agent#i", $_SERVER['HTTP_HOST'] ) ) {
return true; // disable mobile ua check if matches the exclude list in wptouch.
}
}
return false;
}