• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_check_browser_version函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_check_browser_version函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_check_browser_version函数的具体用法?PHP wp_check_browser_version怎么用?PHP wp_check_browser_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_check_browser_version函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: dashboard_browser_nag_class

/**
 * @since 3.2.0
 *
 * @param array $classes
 * @return array
 */
function dashboard_browser_nag_class($classes)
{
    $response = wp_check_browser_version();
    if ($response && $response['insecure']) {
        $classes[] = 'browser-insecure';
    }
    return $classes;
}
开发者ID:riasnelli,项目名称:WordPress,代码行数:14,代码来源:dashboard.php


示例2: ConstructGoogleForm


//.........这里部分代码省略.........
        ', $prefix, $uid, $minvptwidth, $columns, $columnorder, $uid, $prefix);
        //  Remap the re-submit form URL
        $js .= sprintf('
    //  Change "Submit another response" URL to point to WordPress URL
    //  Changing the HREF attribute to an empty string results in the URL
    //  being the page the form is on.
    $("a.ss-bottom-link").attr("href", "");
');
        //  Load the confirmation URL via AJAX?
        if (self::$posted && is_null($action) && !is_null($confirm) && self::$wpgform_submitted_form_id == self::$wpgform_form_id - 1 && $style === WPGFORM_CONFIRM_AJAX && !self::$post_error) {
            $js .= PHP_EOL . '    //  Confirmation page by AJAX page load';
            //$js .= PHP_EOL . '    $("body").load("' . $confirm . ' body") ;' ;
            $js .= PHP_EOL . '    $.get( "' . $confirm . '", function( data ) {
        $( ".result" ).html( data );
    });';
        }
        //  Load the confirmation URL via Redirect?
        if (self::$posted && is_null($action) && !is_null($confirm) && self::$wpgform_submitted_form_id == self::$wpgform_form_id - 1 && $style === WPGFORM_CONFIRM_REDIRECT && !self::$post_error) {
            $js .= PHP_EOL . '    //  Confirmation page by redirect';
            $js .= PHP_EOL . '    window.location.replace("' . $confirm . '") ;';
        }
        $js .= PHP_EOL . '});' . PHP_EOL . '</script>';
        //  Tidy up Javascript to ensure it isn't affected by 'the_content' filters
        //$js = preg_replace($patterns, $replacements, $js) . PHP_EOL ;
        //  Send email?
        if (self::$posted && is_null($action) && ($email || $user_email)) {
            if (is_null($sendto) || empty($sendto)) {
                $sendto = get_bloginfo('admin_email');
            }
            //  If sending notification email, need to account for more than one address
            if ($email) {
                foreach (explode(';', $sendto) as $s) {
                    if (is_email(trim($s))) {
                        wpGForm::SendConfirmationEmail($wpgform_options['email_format'], trim($s), $results);
                    }
                }
            }
            //  Send confirmation email?
            if ($user_email && is_email(self::$wpgform_user_sendto)) {
                wpGForm::SendConfirmationEmail($wpgform_options['email_format'], self::$wpgform_user_sendto);
            }
        }
        //  Check browser compatibility?  The jQuery used by this plugin may
        //  not work correctly on old browsers or IE running in compatibility mode.
        if ($wpgform_options['browser_check'] == 1) {
            require_once ABSPATH . '/wp-admin/includes/dashboard.php';
            //  Let's check the browser version just in case ...
            self::$browser_check = wp_check_browser_version();
            if (self::$browser_check && self::$browser_check['upgrade']) {
                if (self::$browser_check['insecure']) {
                    $css .= '<div class="wpgform-browser-warning gform-browser-warning"><h4>' . __('Warning:  You are using an insecure browser!') . '</h4></div>';
                } else {
                    $css .= '<div class="wpgform-browser-warning gform-browser-warning"><h4>' . __('Warning:  Your browser is out of date!  Please update now.') . '</h4></div>';
                }
            }
        }
        if (WPGFORM_DEBUG) {
            $debug = '<h2 class="wpgform-debug gform-debug"><a href="#" class="wpgform-debug-wrapper gform-debug-wrapper">Show wpGForm Debug Content</a></h2>';
        } else {
            $debug = '';
        }
        //  Assemble final HTML to return.  To handle pages with more than one
        //  form, Javascript, CSS, and debug control should only be rendered once!
        $onetime_html = '';
        if (WPGFORM_DEBUG) {
            printf('<h2>%s:  %s</h2>', __('Form Id:', WPGFORM_I18N_DOMAIN), self::$wpgform_form_id - 1);
            if (!is_null(self::$wpgform_submitted_form_id)) {
                printf('<h2>%s:  %s</h2>', __('Submitted Form Id', WPGFORM_I18N_DOMAIN), self::$wpgform_submitted_form_id);
            } else {
                printf('<h2>%s:</h2>', __('No Submitted Form Id', WPGFORM_I18N_DOMAIN));
            }
        }
        if (!self::$wpgform_js) {
            if (is_null(self::$wpgform_submitted_form_id) || self::$wpgform_submitted_form_id == self::$wpgform_form_id - 1) {
                //self::$wpgform_js = true ;
                self::$wpgform_footer_js .= $js;
            }
        }
        if (!self::$wpgform_css) {
            $onetime_html .= PHP_EOL . $css;
            self::$wpgform_css = true;
        }
        if (!self::$wpgform_debug) {
            $onetime_html .= $debug;
            self::$wpgform_debug = true;
        }
        $html = $onetime_html . $html;
        //  Log form submission?
        if (self::$posted && is_null($action) && $wpgform_options['form_submission_log'] == 1) {
            $unknown = __('Unknown', WPGFORM_I18N_DOMAIN);
            $log = array('url' => array_key_exists('URL', $_SERVER) ? $_SERVER['URL'] : $unknown, 'timestamp' => current_time('Y-m-d H:i:s'), 'remote_addr' => array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : $unknown, 'remote_host' => array_key_exists('REMOTE_HOST', $_SERVER) ? $_SERVER['REMOTE_HOST'] : $unknown, 'http_referer' => array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : $unknown, 'http_user_agent' => array_key_exists('HTTP_USER_AGENT', $_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : $unknown, 'form' => array_key_exists('id', $o) ? $o['id'] : null, 'post_id' => get_the_ID());
            //  Try and log against the Google Form post ID but
            //  fall back to Post or Page ID if the old short code
            //  is being used.
            if (!is_null($log['form'])) {
                add_post_meta($log['form'], WPGFORM_LOG_ENTRY_META_KEY, $log, false);
            }
        }
        return $html;
    }
开发者ID:arobbins,项目名称:foodgroup,代码行数:101,代码来源:wpgform-core.php


示例3: cherry_plugin_import_page

    function cherry_plugin_import_page()
    {
        ?>
			<script>
				if (typeof(window.FileReader) == 'undefined' && window.location.search.indexOf('not_supported=true')==-1) { 
					window.location.search = '?page=import-page&not_supported=true'; 
				}
			</script>
			<?php 
        $response = wp_check_browser_version();
        $browser_not_supported = isset($_GET['not_supported']) || $response['name'] == 'Internet Explorer' && $response['version'] <= 9 || $response['name'] == 'Safari' && $response['version'] <= 6 ? true : false;
        $holder_id = $browser_not_supported ? 'browser_nag' : '';
        $cherry_plugin_components = new cherry_plugin_components();
        $cherry_plugin_components->get_header(array('title' => __('Cherry Content Import', CHERRY_PLUGIN_DOMAIN), 'wrapper_class' => 'impotr_export_wrapper', 'wrapper_id' => $holder_id));
        include_once CHERRY_PLUGIN_DIR . 'admin/import-export/import-check-settings.php';
        $cherry_plugin_components->get_footer();
    }
开发者ID:drupalninja,项目名称:schome_org,代码行数:17,代码来源:plugin-pages.php


示例4: older_ie

 private function older_ie($version)
 {
     global $is_IE;
     // Return early, if not IE
     if (!$is_IE) {
         return false;
     }
     // Include the file, if needed
     if (!function_exists('wp_check_browser_version')) {
         include_once ABSPATH . 'wp-admin/includes/dashboard.php';
     }
     // IE version conditional enqueue
     $response = wp_check_browser_version();
     if (0 > version_compare(intval($response['version']), $version)) {
         return true;
     }
 }
开发者ID:septianadw,项目名称:free-memory,代码行数:17,代码来源:pdf-viewer.php


示例5: seamless_donations_get_browser_name

function seamless_donations_get_browser_name()
{
    $path = plugin_dir_path(__FILE__);
    $path = dirname(dirname(dirname(dirname($path))));
    // up the path (probably a better way)
    $path .= '/wp-admin/includes/dashboard.php';
    require_once $path;
    $browser_data = wp_check_browser_version();
    isset($browser_data['name']) ? $browser_name = $browser_data['name'] : ($browser_name = '');
    isset($browser_data['version']) ? $browser_version = $browser_data['version'] : ($browser_version = '');
    return $browser_name . ' ' . $browser_version;
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:12,代码来源:utilities.php


示例6: is_browser_support

 /**
  * Detect browser support for FIDO U2F.
  *
  * @since 0.1-dev
  */
 public static function is_browser_support()
 {
     global $is_chrome;
     require_once ABSPATH . '/wp-admin/includes/dashboard.php';
     $response = wp_check_browser_version();
     return $is_chrome && version_compare($response['version'], '41') >= 0 && !wp_is_mobile();
 }
开发者ID:jeherve,项目名称:two-factor,代码行数:12,代码来源:class.two-factor-fido-u2f.php



注:本文中的wp_check_browser_version函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_check_filetype函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_category_checklist函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap