• WordPress Mobile Edition lets you insert a call (see their FAQ) into your template to toggle between the regular & mobile versions on an normal (or unrecognized) browser. But, they not this functionality isn’t compatible with WP Super Cache.

    I got this functionality working by adding the following to wp_cache_check_mobile (coincidentally, a function derived from WordPress Mobile Edition — trippy!)


    if( !isset( $wp_cache_mobile_enabled ) || false == $wp_cache_mobile_enabled )
    return $cache_key;

    if (!array_key_exists('cf_action', $_REQUEST) || $_REQUEST['cf_action'] != 'reject_mobile')
    {
    $showMobile = (isset($_REQUEST['cf_action']) && $_REQUEST['cf_action'] == 'show_mobile');
    $mobile = (isset($_COOKIE['cf_mobile']) && $_COOKIE['cf_mobile'] == "true");

    if( $mobile || $showMobile) {
    return $cache_key.'mobile';
    }

    }

    if (!isset($_SERVER["HTTP_USER_AGENT"])) {
    return $cache_key;
    }

    Well, there it is if you’re interested in adding this compatibility to WP Super Cache. I think it would be a great addition to your plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Dana Ross

    (@csixty4)

    Oh yeah, the two lines in wp-mobile.php (part of WordPress Mobile Edition) that look like this:

    if (!defined('WPCACHEHOME')) {

    need to be commented out, along with the corresponding closing braces, in order for this to work.

    Hello,

    This is very cool, sure hope they do use this!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Super Cache] Compat. with WordPress Mobile Edition toggle link?’ is closed to new replies.