Example #1
0
function weaverii_sim_mobile()
{
    if (weaverii_disable_mobile()) {
        return false;
    }
    $sim = weaverii_getopt('_wii_sim_mobile');
    if ($sim && $sim != 'none') {
        if (weaverii_getopt_checked('_wii_sim_mobile_always')) {
            return true;
        }
        if (current_user_can('edit_theme_options')) {
            return true;
        }
    }
    return false;
}
Example #2
0
function weaverii_check_mobile_plugins($before = '<p style="border:1px solid black;padding:2px 2px 2px 6px;background:#faa">', $after = '</p>')
{
    $bad_plugin = '';
    if (function_exists('jetpack_check_mobile')) {
        $bad_plugin = "JetPack's Mobile Theme option";
    }
    if (function_exists('wptouch_init')) {
        $bad_plugin = "WPtouch Mobile Theme plugin";
    }
    if (function_exists('wordpress_mobile_pack_init')) {
        $bad_plugin = "WordPress Mobile Pack plugin";
    }
    if (function_exists('websitez_check_and_act_mobile')) {
        $bad_plugin = "WP Mobile Detector plugin";
    }
    if (function_exists('get_wapl_plugin_base')) {
        $bad_plugin = "Wapple Architect Mobile plugin";
    }
    if ($bad_plugin != '') {
        echo $before;
        if (weaverii_disable_mobile()) {
            ?>
<strong>WARNING:</strong> You are using
<strong><?php 
            echo $bad_plugin;
            ?>
</strong>. You have disabled Weaver II's Smart mobile device
support, but you should be aware that you no longer have the many advantages of Weaver II's
mobile support, and that your desktop and mobile site views will look different.
This is not recommended for an optimal user experience.
<?php 
        } else {
            ?>
<strong style="color:red;">ERROR:</strong> You are using
<strong><?php 
            echo $bad_plugin;
            ?>
</strong>, but have left
Weaver II's Smart Mobile support enabled.
Weaver II's Smart Mobile support is not compatible with alternative Mobile Theme plugins. Using
two methods for mobile devices will result in display conflicts.
<em>You <strong>must</strong> disable <?php 
            echo $bad_plugin;
            ?>
,
or disable Weaver II's mobile support to avoid display conflicts.
</em>
<?php 
        }
        echo $after;
    }
}