本文整理汇总了PHP中Jetpack::permit_ssl方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::permit_ssl方法的具体用法?PHP Jetpack::permit_ssl怎么用?PHP Jetpack::permit_ssl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack
的用法示例。
在下文中一共展示了Jetpack::permit_ssl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax_recheck_ssl
function ajax_recheck_ssl()
{
check_ajax_referer('recheck-ssl', 'ajax-nonce');
$result = Jetpack::permit_ssl(true);
wp_send_json(array('enabled' => $result, 'message' => get_transient('jetpack_https_test_message')));
}
示例2: generate_stats_array
public static function generate_stats_array($prefix = '')
{
$return = array();
$return["{$prefix}version"] = JETPACK__VERSION;
$return["{$prefix}wp-version"] = get_bloginfo('version');
$return["{$prefix}php-version"] = PHP_VERSION;
$return["{$prefix}branch"] = floatval(JETPACK__VERSION);
$return["{$prefix}wp-branch"] = floatval(get_bloginfo('version'));
$return["{$prefix}php-branch"] = floatval(PHP_VERSION);
$return["{$prefix}ssl"] = Jetpack::permit_ssl();
$return["{$prefix}language"] = get_bloginfo('language');
$return["{$prefix}charset"] = get_bloginfo('charset');
$return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
$return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis(1) ? 'yes' : 'no';
$return["{$prefix}plugins"] = implode(',', Jetpack::get_active_plugins());
if (!empty($_SERVER['SERVER_ADDR']) || !empty($_SERVER['LOCAL_ADDR'])) {
$ip = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
$ip_arr = array_map('intval', explode('.', $ip));
if (4 == sizeof($ip_arr)) {
$return["{$prefix}ip-2-octets"] = implode('.', array_slice($ip_arr, 0, 2));
$return["{$prefix}ip-3-octets"] = implode('.', array_slice($ip_arr, 0, 3));
}
}
foreach (Jetpack::get_available_modules() as $slug) {
$return["{$prefix}module-{$slug}"] = Jetpack::is_module_active($slug) ? 'on' : 'off';
}
return $return;
}
示例3: generate_stats_array
public static function generate_stats_array($prefix = '')
{
$return = array();
$return["{$prefix}version"] = JETPACK__VERSION;
$return["{$prefix}wp-version"] = get_bloginfo('version');
$return["{$prefix}php-version"] = PHP_VERSION;
$return["{$prefix}branch"] = floatval(JETPACK__VERSION);
$return["{$prefix}wp-branch"] = floatval(get_bloginfo('version'));
$return["{$prefix}php-branch"] = floatval(PHP_VERSION);
$return["{$prefix}public"] = Jetpack_Options::get_option('public');
$return["{$prefix}ssl"] = Jetpack::permit_ssl();
$return["{$prefix}is-https"] = is_ssl() ? 'https' : 'http';
$return["{$prefix}language"] = get_bloginfo('language');
$return["{$prefix}charset"] = get_bloginfo('charset');
$return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
$return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis(1) ? 'yes' : 'no';
$return["{$prefix}plugins"] = implode(',', Jetpack::get_active_plugins());
$return["{$prefix}single-user-site"] = Jetpack::is_single_user_site();
$return["{$prefix}manage-enabled"] = Jetpack::is_module_active('manage');
// is-multi-network can have three values, `single-site`, `single-network`, and `multi-network`
$return["{$prefix}is-multi-network"] = 'single-site';
if (is_multisite()) {
$return["{$prefix}is-multi-network"] = Jetpack::is_multi_network() ? 'multi-network' : 'single-network';
}
if (!empty($_SERVER['SERVER_ADDR']) || !empty($_SERVER['LOCAL_ADDR'])) {
$ip = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
$ip_arr = array_map('intval', explode('.', $ip));
if (4 == count($ip_arr)) {
$return["{$prefix}ip-2-octets"] = implode('.', array_slice($ip_arr, 0, 2));
}
}
foreach (Jetpack::get_available_modules() as $slug) {
$return["{$prefix}module-{$slug}"] = Jetpack::is_module_active($slug) ? 'on' : 'off';
}
return $return;
}
示例4: recheck_ssl
public static function recheck_ssl()
{
$result = Jetpack::permit_ssl(true);
return array('enabled' => $result, 'message' => get_transient('jetpack_https_test_message'));
}
示例5: generate_stats_array
public static function generate_stats_array($prefix = '')
{
$return = array();
$return["{$prefix}version"] = JETPACK__VERSION;
$return["{$prefix}wp-version"] = get_bloginfo('version');
$return["{$prefix}php-version"] = PHP_VERSION;
$return["{$prefix}branch"] = floatval(JETPACK__VERSION);
$return["{$prefix}wp-branch"] = floatval(get_bloginfo('version'));
$return["{$prefix}php-branch"] = floatval(PHP_VERSION);
$return["{$prefix}public"] = Jetpack_Options::get_option('public');
$return["{$prefix}ssl"] = Jetpack::permit_ssl();
$return["{$prefix}language"] = get_bloginfo('language');
$return["{$prefix}charset"] = get_bloginfo('charset');
$return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
$return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis(1) ? 'yes' : 'no';
$return["{$prefix}plugins"] = implode(',', Jetpack::get_active_plugins());
switch (Jetpack_Options::get_option('json_api_full_management', null)) {
case null:
$return["{$prefix}full_manage"] = 'unset';
break;
case false:
$return["{$prefix}full_manage"] = 'false';
break;
case true:
$return["{$prefix}full_manage"] = 'true';
break;
default:
$return["{$prefix}full_manage"] = Jetpack_Options::get_option('json_api_full_management', null);
}
if (!Jetpack_Options::get_option('public')) {
// Also flag things as private since we don't provide the user with option to easy opt into if the site is private
$return["{$prefix}full_manage"] = 'private-' . $return["{$prefix}full_manage"];
}
// is-multi-network can have three values, `single-site`, `single-network`, and `multi-network`
$return["{$prefix}is-multi-network"] = 'single-site';
if (is_multisite()) {
$return["{$prefix}is-multi-network"] = Jetpack::is_multi_network() ? 'multi-network' : 'single-network';
}
if (!empty($_SERVER['SERVER_ADDR']) || !empty($_SERVER['LOCAL_ADDR'])) {
$ip = !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
$ip_arr = array_map('intval', explode('.', $ip));
if (4 == count($ip_arr)) {
$return["{$prefix}ip-2-octets"] = implode('.', array_slice($ip_arr, 0, 2));
$return["{$prefix}ip-3-octets"] = implode('.', array_slice($ip_arr, 0, 3));
}
}
foreach (Jetpack::get_available_modules() as $slug) {
$return["{$prefix}module-{$slug}"] = Jetpack::is_module_active($slug) ? 'on' : 'off';
}
return $return;
}