本文整理汇总了PHP中Jetpack::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::instance方法的具体用法?PHP Jetpack::instance怎么用?PHP Jetpack::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack
的用法示例。
在下文中一共展示了Jetpack::instance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Singleton
* @static
*/
public static function init()
{
if (!self::$instance) {
if (did_action('plugins_loaded')) {
self::plugin_textdomain();
} else {
add_action('plugins_loaded', array(__CLASS__, 'plugin_textdomain'));
}
self::$instance = new Jetpack();
self::$instance->plugin_upgrade();
}
return self::$instance;
}
示例2: init
/**
* Singleton
* @static
*/
public static function init()
{
if (!self::$instance) {
self::$instance = new Jetpack();
self::$instance->plugin_upgrade();
}
return self::$instance;
}
示例3: test_check_identity_crisis_will_not_report_crisis_if_a_siteurl_mismatch_when_forcing_ssl
/**
* @author tonykova
* @covers Jetpack::check_identity_crisis
* @since 3.2.0
*/
public function test_check_identity_crisis_will_not_report_crisis_if_a_siteurl_mismatch_when_forcing_ssl()
{
// Kick in with force ssl and store master user data
force_ssl_admin(true);
Jetpack_Options::update_option('master_user', 'test');
Jetpack_Options::update_option('user_tokens', array('test' => 'herp.derp.test'));
add_filter('jetpack_development_mode', '__return_false', 1, 1);
// Mock get_cloud_site_options
$jp = $this->getMock('MockJetpack', array('get_cloud_site_options'));
$jp->init();
Jetpack::$instance = $jp;
$jp->expects($this->any())->method('get_cloud_site_options')->will($this->returnValue(array('siteurl' => 'https://test.site.com')));
// Save the mismatching option for comparison
// Using @ to prevent throwing an error on a bug in WP core when attempting to change .htaccess
@update_option('siteurl', 'http://test.site.com');
// Attach hook for checking the errors
add_filter('jetpack_has_identity_crisis', array($this, 'pre_test_check_identity_crisis_will_not_report_crisis_if_a_siteurl_mismatch_when_forcing_ssl'));
$this->assertTrue(false !== MockJetpack::check_identity_crisis(true));
remove_filter('jetpack_has_identity_crisis', array($this, 'pre_test_check_identity_crisis_will_not_report_crisis_if_a_siteurl_mismatch_when_forcing_ssl'));
}
示例4: init
/**
* Singleton
* @static
*/
public static function init()
{
if (!self::$instance) {
self::$instance = new Jetpack();
self::$instance->plugin_upgrade();
add_action('init', array(__CLASS__, 'perform_security_reporting'));
}
return self::$instance;
}