當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jetpack_is_mobile函數代碼示例

本文整理匯總了PHP中jetpack_is_mobile函數的典型用法代碼示例。如果您正苦於以下問題:PHP jetpack_is_mobile函數的具體用法?PHP jetpack_is_mobile怎麽用?PHP jetpack_is_mobile使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了jetpack_is_mobile函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: landscape_has_footer_widgets

 function landscape_has_footer_widgets()
 {
     if (jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
開發者ID:pradeep-web,項目名稱:brandt,代碼行數:7,代碼來源:jetpack.php

示例2: twentyfourteen_has_footer_widgets

 function twentyfourteen_has_footer_widgets($has_widgets)
 {
     if (Jetpack_User_Agent_Info::is_ipad() && is_active_sidebar('sidebar-1') || jetpack_is_mobile('', true) && (is_active_sidebar('sidebar-1') || is_active_sidebar('sidebar-2')) || is_active_sidebar('sidebar-3')) {
         return true;
     }
     return $has_widgets;
 }
開發者ID:kanei,項目名稱:vantuch.cz,代碼行數:7,代碼來源:twentyfourteen.php

示例3: penscratch_has_footer_widgets

 function penscratch_has_footer_widgets()
 {
     if (has_nav_menu('social') || jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
開發者ID:hlgrogan,項目名稱:Sphinx-Site,代碼行數:7,代碼來源:jetpack.php

示例4: panel_has_footer_widgets

 function panel_has_footer_widgets()
 {
     if (is_active_sidebar('footer-sidebar-1') || is_active_sidebar('footer-sidebar-2') || is_active_sidebar('footer-sidebar-3') || is_active_sidebar('sidebar-1') && jetpack_is_mobile('', true)) {
         return true;
     }
     return false;
 }
開發者ID:jun200,項目名稱:wordpress,代碼行數:7,代碼來源:jetpack.php

示例5: oriental_infinite_scroll_has_footer_widgets

 function oriental_infinite_scroll_has_footer_widgets()
 {
     if (function_exists('jetpack_is_mobile') && jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
開發者ID:AtomPy,項目名稱:AtomPySite,代碼行數:7,代碼來源:functions.php

示例6: tinyframework_has_footer_widgets

/**
 * Check whether or not footer widgets are present. If they are present, then a button to
 * 'Load more posts' will be displayed and Infinite Scroll will not be triggered unless a user manually clicks on that button.
 *
 * @param bool $has_widgets
 * @uses Jetpack_User_Agent_Info::is_ipad, jetpack_is_mobile, is_active_sidebar
 * @filter infinite_scroll_has_footer_widgets
 * @return bool
 */
function tinyframework_has_footer_widgets($has_widgets)
{
    if ((Jetpack_User_Agent_Info::is_ipad() || function_exists('jetpack_is_mobile') && jetpack_is_mobile()) && is_active_sidebar('sidebar-1')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
開發者ID:guillermohernandez,項目名稱:OYFF-Wordpress-Theme,代碼行數:16,代碼來源:plugin-compatibility.php

示例7: jetpack_check_mobile

function jetpack_check_mobile()
{
    if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST || defined('APP_REQUEST') && APP_REQUEST) {
        return false;
    }
    if (!isset($_SERVER["HTTP_USER_AGENT"]) || isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'false') {
        return false;
    }
    if (jetpack_mobile_exclude()) {
        return false;
    }
    if (1 == get_option('wp_mobile_disable')) {
        return false;
    }
    if (isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'true') {
        return true;
    }
    $is_mobile = jetpack_is_mobile();
    /**
     * Filter the Mobile check results.
     *
     * @module minileven
     *
     * @since 1.8.0
     *
     * @param bool $is_mobile Is the reader on a mobile device.
     */
    return apply_filters('jetpack_check_mobile', $is_mobile);
}
開發者ID:StefanBonilla,項目名稱:CoupSoup,代碼行數:29,代碼來源:minileven.php

示例8: harmonic_infinite_scroll_has_footer_widgets

 function harmonic_infinite_scroll_has_footer_widgets()
 {
     if (jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
開發者ID:Matwilk,項目名稱:wordpress,代碼行數:7,代碼來源:jetpack.php

示例9: sorbet_infinite_scroll_footer_widgets

function sorbet_infinite_scroll_footer_widgets()
{
    if (has_nav_menu('secondary') || jetpack_is_mobile() && is_active_sidebar('sidebar-1')) {
        return true;
    }
    return false;
}
開發者ID:kanoka42,項目名稱:kanoka42.github.io,代碼行數:7,代碼來源:jetpack.php

示例10: infinite_scroll_has_footer_widgets

 function infinite_scroll_has_footer_widgets()
 {
     if (jetpack_is_mobile('', true) && is_active_sidebar('primary-sidebar')) {
         return true;
     }
     return false;
 }
開發者ID:birdy10,項目名稱:projetWordpress,代碼行數:7,代碼來源:functions.php

示例11: encounters_lite_has_footer_widgets

/**
 * Check whether or not footer widgets are present. If they are present, then a button to
 * 'Load more posts' will be displayed and IS will not be triggered unless a user manually clicks on that button.
 *
 * @param bool $has_widgets
 * @uses Jetpack_User_Agent_Info::is_ipad, jetpack_is_mobile, is_active_sidebar
 * @filter infinite_scroll_has_footer_widgets
 * @return bool
 */
function encounters_lite_has_footer_widgets($has_widgets)
{
    if ((Jetpack_User_Agent_Info::is_ipad() || function_exists('jetpack_is_mobile') && jetpack_is_mobile()) && is_active_sidebar('bottom1')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
開發者ID:double360,項目名稱:wordpress,代碼行數:16,代碼來源:jetpack.php

示例12: wpcom_vip_disable_lazyload_on_mobile

function wpcom_vip_disable_lazyload_on_mobile($enabled)
{
    if (function_exists('jetpack_is_mobile') && jetpack_is_mobile()) {
        $enabled = false;
    }
    if (class_exists('Jetpack_User_Agent_Info') && Jetpack_User_Agent_Info::is_ipad()) {
        $enabled = false;
    }
    return $enabled;
}
開發者ID:gopinathshiva,項目名稱:wordpress-vip-plugins,代碼行數:10,代碼來源:wpcom-helper.php

示例13: init

 static function init()
 {
     add_action('switch_theme', array(__CLASS__, 'reset'));
     add_action('wp_restore_post_revision', array(__CLASS__, 'restore_revision'), 10, 2);
     // Save revisions for posts of type safecss.
     add_filter('revision_redirect', array(__CLASS__, 'revision_redirect'));
     // Override the edit link, the default link causes a redirect loop
     add_filter('get_edit_post_link', array(__CLASS__, 'revision_post_link'), 10, 3);
     // Overwrite the content width global variable if one is set in the custom css
     add_action('template_redirect', array(__CLASS__, 'set_content_width'));
     add_action('admin_init', array(__CLASS__, 'set_content_width'));
     if (!is_admin()) {
         add_filter('stylesheet_uri', array(__CLASS__, 'style_filter'));
     }
     define('SAFECSS_USE_ACE', !jetpack_is_mobile() && !Jetpack_User_Agent_Info::is_ipad() && apply_filters('safecss_use_ace', true));
     // Register safecss as a custom post_type
     // Explicit capability definitions are largely unnecessary because the posts are manipulated in code via an options page, managing CSS revisions does check the capabilities, so let's ensure that the proper caps are checked.
     register_post_type('safecss', array('supports' => array('revisions'), 'label' => 'Custom CSS', 'can_export' => false, 'rewrite' => false, 'capabilities' => array('edit_post' => 'edit_theme_options', 'read_post' => 'read', 'delete_post' => 'edit_theme_options', 'edit_posts' => 'edit_theme_options', 'edit_others_posts' => 'edit_theme_options', 'publish_posts' => 'edit_theme_options', 'read_private_posts' => 'read')));
     // Short-circuit WP if this is a CSS stylesheet request
     if (isset($_GET['custom-css'])) {
         header('Content-Type: text/css', true, 200);
         header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
         // 1 year
         Jetpack_Custom_CSS::print_css();
         exit;
     }
     add_action('admin_enqueue_scripts', array('Jetpack_Custom_CSS', 'enqueue_scripts'));
     if (isset($_GET['page']) && 'editcss' == $_GET['page'] && is_admin()) {
         // Do migration routine if necessary
         Jetpack_Custom_CSS::upgrade();
         do_action('safecss_migrate_post');
     }
     add_action('wp_head', array('Jetpack_Custom_CSS', 'link_tag'), 101);
     add_filter('jetpack_content_width', array('Jetpack_Custom_CSS', 'jetpack_content_width'));
     add_filter('editor_max_image_size', array('Jetpack_Custom_CSS', 'editor_max_image_size'), 10, 3);
     if (!current_user_can('switch_themes') && !is_super_admin()) {
         return;
     }
     add_action('admin_menu', array('Jetpack_Custom_CSS', 'menu'));
     if (isset($_POST['safecss']) && false == strstr($_SERVER['REQUEST_URI'], 'options.php')) {
         check_admin_referer('safecss');
         $save_result = self::save(array('css' => stripslashes($_POST['safecss']), 'is_preview' => isset($_POST['action']) && $_POST['action'] == 'preview', 'preprocessor' => isset($_POST['custom_css_preprocessor']) ? $_POST['custom_css_preprocessor'] : '', 'add_to_existing' => isset($_POST['add_to_existing']) ? $_POST['add_to_existing'] == 'true' : true, 'content_width' => isset($_POST['custom_content_width']) ? $_POST['custom_content_width'] : false));
         if ($_POST['action'] == 'preview') {
             wp_safe_redirect(add_query_arg('csspreview', 'true', get_option('home')));
             exit;
         }
         if ($save_result) {
             add_action('admin_notices', array('Jetpack_Custom_CSS', 'saved_message'));
         }
     }
     // Modify all internal links so that preview state persists
     if (Jetpack_Custom_CSS::is_preview()) {
         ob_start(array('Jetpack_Custom_CSS', 'buffer'));
     }
 }
開發者ID:lokenxo,項目名稱:familygenerator,代碼行數:55,代碼來源:custom-css.php

示例14: twenty_twelve_has_footer_widgets

/**
 * Handle `footer_widgets` argument for mobile devices
 *
 * @param bool $has_widgets
 * @uses jetpack_is_mobile, is_front_page, is_active_sidebar
 * @filter infinite_scroll_has_footer_widgets
 * @return bool
 */
function twenty_twelve_has_footer_widgets($has_widgets)
{
    if (function_exists('jetpack_is_mobile') && jetpack_is_mobile()) {
        if (is_front_page() && (is_active_sidebar('sidebar-2') || is_active_sidebar('sidebar-3'))) {
            $has_widgets = true;
        } elseif (is_active_sidebar('sidebar-1')) {
            $has_widgets = true;
        }
    }
    return $has_widgets;
}
開發者ID:jfbelisle,項目名稱:magexpress,代碼行數:19,代碼來源:twentytwelve.php

示例15: twenty_eleven_has_footer_widgets

/**
 * Have we any footer widgets?
 *
 * @param bool $has_widgets
 * @uses is_active_sidebar
 * @uses jetpack_is_mobile
 * @filter infinite_scroll_has_footer_widgets
 * @return bool
 */
function twenty_eleven_has_footer_widgets($has_widgets)
{
    // Are any of the "Footer Area" sidebars active?
    if (is_active_sidebar('sidebar-3') || is_active_sidebar('sidebar-4') || is_active_sidebar('sidebar-5')) {
        return true;
    }
    // If we're on mobile and the Main Sidebar has widgets, it falls below the content, so we have footer widgets.
    if (function_exists('jetpack_is_mobile') && jetpack_is_mobile() && is_active_sidebar('sidebar-1')) {
        return true;
    }
    return $has_widgets;
}
開發者ID:StefanBonilla,項目名稱:CoupSoup,代碼行數:21,代碼來源:twentyeleven.php


注:本文中的jetpack_is_mobile函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。