当前位置: 首页>>代码示例>>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;未经允许,请勿转载。