本文整理汇总了PHP中Util_Environment::is_w3tc_edge方法的典型用法代码示例。如果您正苦于以下问题:PHP Util_Environment::is_w3tc_edge方法的具体用法?PHP Util_Environment::is_w3tc_edge怎么用?PHP Util_Environment::is_w3tc_edge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util_Environment
的用法示例。
在下文中一共展示了Util_Environment::is_w3tc_edge方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_head
/**
* Print JS required by the support nag.
*/
function admin_head()
{
$state = Dispatcher::config_state_master();
// support us
$support_reminder = $state->get_integer('common.support_us_invitations') < 3 && $state->get_integer('common.install') < time() - W3TC_SUPPORT_US_TIMEOUT && $state->get_integer('common.next_support_us_invitation') < time() && $this->_config->get_string('common.support') == '' && !$this->_config->get_boolean('common.tweeted');
if ($support_reminder) {
$state->set('common.next_support_us_invitation', time() + W3TC_SUPPORT_US_TIMEOUT);
$state->set('common.support_us_invitations', $state->get_integer('common.support_us_invitations') + 1);
$state->save();
do_action('w3tc_message_action_generic_support_us');
}
// edge mode
$edge_reminder = !$support_reminder && !Util_Environment::is_w3tc_edge($this->_config) && $state->get_integer('common.edge_invitations') < 3 && $state->get_integer('common.install') < time() - W3TC_EDGE_TIMEOUT && $state->get_integer('common.next_edge_invitation') < time();
if ($edge_reminder) {
if ($state->get_integer('common.edge_invitations') > 1) {
$next = time() + 30 * 24 * 60 * 60;
} else {
$next = time() + W3TC_EDGE_TIMEOUT;
}
$state->set('common.next_edge_invitation', $next);
$state->set('common.edge_invitations', $state->get_integer('common.edge_invitations') + 1);
$state->save();
do_action('w3tc_message_action_generic_edge');
}
}
示例2: admin_print_scripts_w3tc_general
public function admin_print_scripts_w3tc_general()
{
$state = Dispatcher::config_state();
if (!$state->get_boolean('minify.hide_minify_help') && !Util_Environment::is_w3tc_edge($this->_config) && !Util_Environment::is_w3tc_enterprise($this->_config)) {
wp_enqueue_script('w3tc-minify-help', plugins_url('Minify_GeneralPage_View_ShowHelp.js', W3TC_FILE), array(), W3TC_VERSION);
}
}
示例3: admin_init
public function admin_init()
{
$config = Dispatcher::config();
$groups = $config->get_array('mobile.rgroups');
if (Util_Environment::is_w3tc_edge($config) && isset($groups['google']) && sizeof($groups['google']['agents']) == 1 && $groups['google']['agents'][0] == 'googlebot') {
w3tc_delete_user_agent_group('google');
}
}
示例4: parse
/**
* Parses FAQ XML file into array
*
* @return array
*/
public static function parse()
{
$config = Dispatcher::config();
$faq = array();
self::parse_file($faq, 'faq', '', '');
if (Util_Environment::is_w3tc_edge($config)) {
self::parse_file($faq, 'faq-edge', 'edge', '<b>Edge:</b> ');
}
if (Util_Environment::is_w3tc_pro($config)) {
self::parse_file($faq, 'faq-pro', 'pro', '<b>Pro:</b> ');
}
return $faq;
}
示例5: __
</th>
</tr>
<?php
Util_Ui::config_item(array('key' => 'common.track_usage', 'control' => 'checkbox', 'checkbox_label' => __('Anonymously track usage to improve product quality', 'w3-total-cache'), 'style' => '2'));
?>
<?php
do_action('w3tc_settings_general_boxarea_miscellaneous_content');
?>
<?php
if (is_network_admin() || !Util_Environment::is_wpmu()) {
?>
<tr id="edge_mode">
<th colspan="2">
<?php
if (!Util_Environment::is_w3tc_edge($this->_config)) {
echo '<a href="' . Util_Ui::url(array('w3tc_edge_mode_enable' => 'y')) . '"><strong>' . __('Enable Edge mode', 'w3-total-cache') . '</strong></a>';
} else {
echo '<a href="' . Util_Ui::url(array('w3tc_edge_mode_disable' => 'y')) . '"><strong>' . __('Disable Edge mode', 'w3-total-cache') . '</strong></a>';
}
?>
<br /><span class="description"><?php
_e('Enable this to try out new functionality under development. Might cause issues on some sites.', 'w3-total-cache');
?>
</span>
</th>
</tr>
<?php
}
?>
</table>
示例6: sprintf
<?php
namespace W3TC;
if (!defined('W3TC')) {
die;
}
include W3TC_INC_DIR . '/options/common/header.php';
?>
<p>
<?php
echo sprintf(__('The plugin is currently <span class="w3tc-%s">%s</span> in <strong>%s%s</strong> mode.', 'w3-total-cache'), $enabled ? "enabled" : "disabled", $enabled ? __('enabled', 'w3-total-cache') : __('disabled', 'w3-total-cache'), Util_Environment::w3tc_edition($this->_config), Util_Environment::is_w3tc_edge($this->_config) ? __(' edge', 'w3-total-cache') : '');
?>
</p>
<form id="w3tc_dashboard" action="admin.php?page=<?php
echo $this->_page;
?>
" method="post">
<p>
Perform a
<input type="button" class="button button-self-test {nonce: '<?php
echo wp_create_nonce('w3tc');
?>
'}" value="<?php
_e('compatibility check', 'w3-total-cache');
?>
" />,
<?php
echo Util_Ui::nonce_field('w3tc');
?>