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


PHP wp_check_browser_version函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。