wp_super_cache_maybe_disable_wptouch()WPSCache 1.0

disable mobile checking if.

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wp_super_cache_maybe_disable_wptouch( $t );
$t (обязательный)
-

Код wp_super_cache_maybe_disable_wptouch() WPSCache 1.12.0

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;
}