当前位置: 首页>>代码示例>>PHP>>正文


PHP Jetpack::dns_prefetch方法代码示例

本文整理汇总了PHP中Jetpack::dns_prefetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::dns_prefetch方法的具体用法?PHP Jetpack::dns_prefetch怎么用?PHP Jetpack::dns_prefetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jetpack的用法示例。


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

示例1: dirname

<?php

/**
 * Module Name: VideoPress
 * Module Description: Powerful, simple video hosting for WordPress
 * First Introduced: 2.5
 * Free: false
 * Requires Connection: Yes
 * Sort Order: 27
 * Module Tags: Photos and Videos
 * Feature: Writing
 * Additional Search Queries: video, videos, videopress
 */
Jetpack::dns_prefetch(array('//v0.wordpress.com'));
/**
 * We won't have any videos less than sixty pixels wide. That would be silly.
 */
define('VIDEOPRESS_MIN_WIDTH', 60);
include_once dirname(__FILE__) . '/videopress/utility-functions.php';
include_once dirname(__FILE__) . '/videopress/shortcode.php';
include_once dirname(__FILE__) . '/videopress/videopress.php';
开发者ID:elliott-stocks,项目名称:jetpack,代码行数:21,代码来源:videopress.php

示例2: init

<?php

/**
 * Module Name: Likes
 * Module Description: Give visitors an easy way to show their appreciation for your content.
 * First Introduced: 2.2
 * Sort Order: 23
 * Requires Connection: Yes
 * Auto Activate: No
 * Module Tags: Social
 */
Jetpack::dns_prefetch(array('//widgets.wp.com', '//s0.wp.com', '//0.gravatar.com', '//1.gravatar.com', '//2.gravatar.com'));
class Jetpack_Likes
{
    public $version = '20141028';
    public static function init()
    {
        static $instance = NULL;
        if (!$instance) {
            $instance = new Jetpack_Likes();
        }
        return $instance;
    }
    function __construct()
    {
        $this->in_jetpack = defined('IS_WPCOM') && IS_WPCOM ? false : true;
        add_action('init', array(&$this, 'action_init'));
        add_action('admin_init', array($this, 'admin_init'));
        if ($this->in_jetpack) {
            add_action('jetpack_activate_module_likes', array($this, 'maybe_sync_content'));
            add_action('jetpack_activate_module_likes', array($this, 'module_toggle'));
开发者ID:CoderDojoTo,项目名称:CDWP-theme,代码行数:31,代码来源:likes.php

示例3:

<?php

/**
 * Module Name: Photon
 * Module Description: Speed up images and photos.
 * Jumpstart Description: Mirrors and serves your images from our free and fast image CDN, improving your site’s performance with no additional load on your servers.
 * Sort Order: 25
 * Recommendation Order: 1
 * First Introduced: 2.0
 * Requires Connection: Yes
 * Auto Activate: No
 * Module Tags: Photos and Videos, Appearance, Recommended
 * Feature: Recommended, Jumpstart, Appearance
 * Additional Search Queries: photon, image, cdn, performance, speed
 */
Jetpack::dns_prefetch(array('//i0.wp.com', '//i1.wp.com', '//i2.wp.com'));
Jetpack_Photon::instance();
开发者ID:kanei,项目名称:vantuch.cz,代码行数:17,代码来源:photon.php

示例4: test_dns_prefetch

 /**
  * @author georgestephanis
  * @covers Jetpack::dns_prefetch
  * @since 3.3.0
  */
 public function test_dns_prefetch()
 {
     // Purge it for a clean start.
     ob_start();
     Jetpack::dns_prefetch();
     ob_end_clean();
     Jetpack::dns_prefetch('http://example1.com/');
     Jetpack::dns_prefetch(array('http://example2.com/', 'https://example3.com'));
     Jetpack::dns_prefetch('https://example2.com');
     $expected = "\r\n" . "<link rel='dns-prefetch' href='//example1.com'>\r\n" . "<link rel='dns-prefetch' href='//example2.com'>\r\n" . "<link rel='dns-prefetch' href='//example3.com'>\r\n";
     $this->assertEquals($expected, get_echo(array('Jetpack', 'dns_prefetch')));
 }
开发者ID:atrus1701,项目名称:jetpack,代码行数:17,代码来源:test_class.jetpack.php

示例5: dirname

<?php

/**
 * Module Name: Jetpack Comments
 * Module Description: Let readers comment with WordPress.com, Twitter, Facebook, or Google+ accounts.
 * First Introduced: 1.4
 * Sort Order: 20
 * Requires Connection: Yes
 * Auto Activate: No
 * Module Tags: Social
 */
require dirname(__FILE__) . '/comments/comments.php';
if (is_admin()) {
    require dirname(__FILE__) . '/comments/admin.php';
}
Jetpack_Sync::sync_options(__FILE__, 'comment_registration', 'require_name_email', 'show_avatars', 'avatar_default', 'highlander_comment_form_prompt', 'jetpack_comment_form_color_scheme');
function jetpack_comments_load()
{
    Jetpack::enable_module_configurable(__FILE__);
    Jetpack::module_configuration_load(__FILE__, 'jetpack_comments_configuration_load');
}
function jetpack_comments_configuration_load()
{
    wp_safe_redirect(admin_url('options-discussion.php#jetpack-comments-settings'));
    exit;
}
add_action('jetpack_modules_loaded', 'jetpack_comments_load');
Jetpack::dns_prefetch(array('//jetpack.wordpress.com', '//s0.wp.com', '//s1.wp.com', '//s2.wp.com', '//public-api.wordpress.com', '//0.gravatar.com', '//1.gravatar.com', '//2.gravatar.com'));
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:28,代码来源:comments.php

示例6: test_dns_prefetch

 /**
  * @author georgestephanis
  * @covers Jetpack::dns_prefetch
  * @since 3.3.0
  */
 public function test_dns_prefetch()
 {
     // Save URLs that are already in to remove them later and perform a clean test.
     ob_start();
     Jetpack::dns_prefetch();
     $remove_this = ob_get_clean();
     Jetpack::dns_prefetch('http://example1.com/');
     Jetpack::dns_prefetch(array('http://example2.com/', 'https://example3.com'));
     Jetpack::dns_prefetch('https://example2.com');
     $expected = "\r\n" . "<link rel='dns-prefetch' href='//example1.com'>\r\n" . "<link rel='dns-prefetch' href='//example2.com'>\r\n" . "<link rel='dns-prefetch' href='//example3.com'>\r\n";
     $this->assertEquals($expected, str_replace($remove_this, "\r\n", get_echo(array('Jetpack', 'dns_prefetch'))));
 }
开发者ID:iamtakashi,项目名称:jetpack,代码行数:17,代码来源:test_class.jetpack.php


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