• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_super_cache_disable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_super_cache_disable函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_super_cache_disable函数的具体用法?PHP wp_super_cache_disable怎么用?PHP wp_super_cache_disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: disable

 /**
  * Disable the WP Super Cache.
  */
 function disable($args = array(), $assoc_args = array())
 {
     global $super_cache_enabled;
     wp_super_cache_disable();
     if (!$super_cache_enabled) {
         WP_CLI::success('The WP Super Cache is disabled.');
     } else {
         WP_CLI::error('The WP Super Cache is still enabled, check its settings page for more info.');
     }
 }
开发者ID:joelw,项目名称:wp-super-cache-cli,代码行数:13,代码来源:cli.php


示例2: wp_supercache_ktaistyle_admin

 function wp_supercache_ktaistyle_admin()
 {
     global $valid_nonce, $wp_cache_config_file, $cache_ktaistyle, $wp_cache_mobile_browsers, $orig_wp_cache_mobile_browsers;
     if (!isset($cache_ktaistyle)) {
         $cache_ktaistyle = 0;
     }
     $ktaistyle_browsers = 'DoCoMo/, J-PHONE/, J-EMULATOR/, Vodafone/, MOT-, MOTEMULATOR-, SoftBank/, emulator/, DDIPOCKET;, WILLCOM;, KDDI-, UP.Browser/, emobile/, Huawei/, IAC/, Nokia, Opera Mini, Opera Mobi, Palm OS, Windows CE;, PDA; SL-, PlayStation Portable, SONY/COM, Nitro, Nintendo, mixi-mobile-converter/';
     if (function_exists('ks_option') && ks_option('ks_theme_touch')) {
         $ktaistyle_browsers .= ', iPhone;, iPod;, Android';
     }
     if (isset($_POST['cache_ktaistyle']) && $valid_nonce) {
         if (!class_exists('KtaiStyle') && !class_exists('Ktai_Style')) {
             $_POST['cache_ktaistyle'] = __('Disable', 'wp-super-cache');
             $err = __('Ktai Style not found. Please check your install.', 'wp-super-cache');
         }
         $cache_ktaistyle = $_POST['cache_ktaistyle'] == __('Disable', 'wp-super-cache') ? 0 : 1;
         wp_cache_replace_line('^ *\\$cache_ktaistyle', "\$cache_ktaistyle = '{$cache_ktaistyle}';", $wp_cache_config_file);
         if ($cache_ktaistyle) {
             if (!isset($orig_wp_cache_mobile_browsers)) {
                 wp_cache_replace_line('^ *\\$orig_wp_cache_mobile_browsers', "\$orig_wp_cache_mobile_browsers = '{$wp_cache_mobile_browsers}';", $wp_cache_config_file);
             }
             wp_cache_replace_line('^ *\\$wp_cache_mobile_browsers ', "\$wp_cache_mobile_browsers = '{$ktaistyle_browsers}';", $wp_cache_config_file);
         } elseif (isset($orig_wp_cache_mobile_browsers) && $orig_wp_cache_mobile_browsers != $ktaistyle_browsers) {
             wp_cache_replace_line('^ *\\$wp_cache_mobile_browsers ', "\$wp_cache_mobile_browsers = '{$orig_wp_cache_mobile_browsers}';", $wp_cache_config_file);
             wp_cache_replace_line('^ *\\$orig_wp_cache_mobile_browsers', '', $wp_cache_config_file);
         }
     }
     echo '<form name="wp_supercache_ktaistyle_admin" action="' . $_SERVER["REQUEST_URI"] . '" method="post">';
     wp_nonce_field('wp-cache');
     if ($cache_ktaistyle == 0) {
         $ks_status = __('disabled', 'wp-super-cache');
     } else {
         $ks_status = __('enabled', 'wp-super-cache');
         wp_super_cache_disable();
     }
     echo '<strong>' . sprintf(__('Ktai Style support is %s', 'wp-super-cache'), $ks_status);
     echo '.</strong>';
     printf(__('(Changing supporting mobile devices. Requires <a href="http://wppluginsj.sourceforge.jp/ktai_style/">Ktai Style</a>.) ', 'wp-super-cache'));
     if ($cache_ktaistyle == 0) {
         echo '<input type="submit" name="cache_ktaistyle" value="' . __('Enable', 'wp-super-cache') . '" />';
     } else {
         echo '<input type="submit" name="cache_ktaistyle" value="' . __('Disable', 'wp-super-cache') . '" />';
     }
     echo "</form>\n";
     if ($err) {
         echo "<p><strong>" . __('Warning!', 'wp-super-cache') . "</strong> {$err}</p>";
     }
 }
开发者ID:masayukiando,项目名称:wordpress-event-search,代码行数:48,代码来源:supercache-plugin-ktaistyle.php


示例3: wp_supercache_badbehaviour_admin

function wp_supercache_badbehaviour_admin()
{
    global $cache_badbehaviour, $wp_cache_config_file, $valid_nonce;
    $cache_badbehaviour = $cache_badbehaviour == '' ? 'no' : $cache_badbehaviour;
    $err = false;
    if (isset($_POST['cache_badbehaviour']) && $valid_nonce) {
        $bbfile = get_bb_file_loc();
        if (!$bbfile) {
            $_POST['cache_badbehaviour'] = 'Disable';
            $err = __('Bad Behaviour not found. Please check your install.', 'wp-super-cache');
        }
        $cache_badbehaviour = $_POST['cache_badbehaviour'] == __('Disable', 'wp-super-cache') ? 0 : 1;
        wp_cache_replace_line('^ *\\$cache_compression', "\$cache_compression = 0;", $wp_cache_config_file);
        wp_cache_replace_line('^ *\\$cache_badbehaviour', "\$cache_badbehaviour = {$cache_badbehaviour};", $wp_cache_config_file);
        wp_cache_replace_line('^ *\\$cache_badbehaviour_file', "\$cache_badbehaviour_file = '{$bbfile}';", $wp_cache_config_file);
    }
    echo '<form name="wp_supercache_badbehaviour_admin" action="' . $_SERVER["REQUEST_URI"] . '" method="post">';
    wp_nonce_field('wp-cache');
    if ($cache_badbehaviour == 0) {
        $bb_status = __('disabled', 'wp-super-cache');
    } else {
        $bb_status = __('enabled', 'wp-super-cache');
        wp_super_cache_disable();
    }
    echo '<strong>' . sprintf(__('Bad Behaviour support is %s', 'wp-super-cache'), $bb_status);
    echo '.</strong>';
    printf(__('(Only half-on caching supported, disabled compression and requires <a href="http://www.bad-behavior.ioerror.us/">Bad Behavior</a> in "%s/plugins/bad-behavior/") ', 'wp-super-cache'), WP_CONTENT_DIR);
    if ($cache_badbehaviour == 0) {
        echo '<input type="submit" name="cache_badbehaviour" value="' . __('Enable', 'wp-super-cache') . '" />';
    } else {
        echo '<input type="submit" name="cache_badbehaviour" value="' . __('Disable', 'wp-super-cache') . '" />';
    }
    echo "</form>\n";
    if ($err) {
        echo "<p><strong>" . __('Warning!', 'wp-super-cache') . "</strong> {$err}</p>";
    }
}
开发者ID:jeremylightsmith,项目名称:blog,代码行数:37,代码来源:badbehaviour.php


示例4: wp_cache_disable

function wp_cache_disable()
{
    global $cache_path, $wp_cache_config_file, $cache_enabled, $supercachedir, $cache_path;
    if (wp_cache_replace_line('^ *\\$cache_enabled', '$cache_enabled = false;', $wp_cache_config_file)) {
        $cache_enabled = false;
    }
    wp_super_cache_disable();
    sleep(1);
    // allow existing processes to write to the supercachedir and then delete it
    if (function_exists('prune_super_cache') && is_dir($supercachedir)) {
        prune_super_cache($cache_path, true);
    }
}
开发者ID:alx,项目名称:alexgirard.com-blog,代码行数:13,代码来源:wp-cache.php


示例5: wp_cache_disable

function wp_cache_disable()
{
    global $wp_cache_config_file, $cache_enabled;
    if (wp_cache_replace_line('^ *\\$cache_enabled', '$cache_enabled = false;', $wp_cache_config_file)) {
        $cache_enabled = false;
    }
    wp_super_cache_disable();
}
开发者ID:jeremylightsmith,项目名称:blog,代码行数:8,代码来源:wp-cache.php


示例6: wp_cache_manager_updates

function wp_cache_manager_updates()
{
    global $wp_cache_mobile_enabled, $wp_supercache_cache_list, $wp_cache_config_file, $wp_cache_hello_world, $wp_cache_clear_on_post_edit, $cache_rebuild_files, $wp_cache_mutex_disabled, $wp_cache_not_logged_in, $wp_cache_make_known_anon, $cache_path, $wp_cache_object_cache, $_wp_using_ext_object_cache, $wp_cache_refresh_single_only, $cache_compression, $wp_cache_mod_rewrite, $wp_supercache_304, $wp_super_cache_late_init, $wp_cache_front_page_checks, $cache_page_secret;
    if (!wpsupercache_site_admin()) {
        return false;
    }
    if (false == isset($cache_page_secret)) {
        $cache_page_secret = md5(date('H:i:s') . mt_rand());
        wp_cache_replace_line('^ *\\$cache_page_secret', "\$cache_page_secret = '" . $cache_page_secret . "';", $wp_cache_config_file);
    }
    // Delete cache for a specific page
    if (isset($_GET['action']) && $_GET['action'] == 'delete' && (isset($_GET['_wpnonce']) ? wp_verify_nonce($_REQUEST['_wpnonce'], 'delete-cache') : false)) {
        $path = get_supercache_dir() . preg_replace('/:.*$/', '', $_GET['path']);
        $files = get_all_supercache_filenames($path);
        foreach ($files as $cache_file) {
            prune_super_cache($path . $cache_file, true);
        }
        wp_redirect(preg_replace('/[ <>\'\\"\\r\\n\\t\\(\\)]/', '', $_GET['path']));
        die;
    }
    $valid_nonce = isset($_REQUEST['_wpnonce']) ? wp_verify_nonce($_REQUEST['_wpnonce'], 'wp-cache') : false;
    if ($valid_nonce == false) {
        return false;
    }
    if (isset($_POST['action']) && $_POST['action'] == 'easysetup') {
        $_POST['action'] = 'scupdates';
        if (isset($_POST['wp_cache_easy_on']) && $_POST['wp_cache_easy_on'] == 1) {
            $_POST['wp_cache_mobile_enabled'] = 1;
            $_POST['wp_cache_status'] = 'all';
            $_POST['super_cache_enabled'] = 2;
            // PHP
            $_POST['cache_rebuild_files'] = 1;
            unset($_POST['cache_compression']);
        } else {
            unset($_POST['wp_cache_status']);
            $_POST['super_cache_enabled'] = 0;
        }
    }
    if (isset($_POST['action']) && $_POST['action'] == 'scupdates') {
        if (isset($_POST['wp_super_cache_late_init'])) {
            $wp_super_cache_late_init = 1;
        } else {
            $wp_super_cache_late_init = 0;
        }
        wp_cache_replace_line('^ *\\$wp_super_cache_late_init', "\$wp_super_cache_late_init = " . $wp_super_cache_late_init . ";", $wp_cache_config_file);
        if (isset($_POST['wp_supercache_304'])) {
            $wp_supercache_304 = 1;
        } else {
            $wp_supercache_304 = 0;
        }
        wp_cache_replace_line('^ *\\$wp_supercache_304', "\$wp_supercache_304 = " . $wp_supercache_304 . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_mobile_enabled'])) {
            $wp_cache_mobile_enabled = 1;
        } else {
            $wp_cache_mobile_enabled = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_front_page_checks'])) {
            $wp_cache_front_page_checks = 1;
        } else {
            $wp_cache_front_page_checks = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_front_page_checks', "\$wp_cache_front_page_checks = " . $wp_cache_front_page_checks . ";", $wp_cache_config_file);
        $wp_supercache_cache_list = $_POST['wp_supercache_cache_list'] == 1 ? 1 : 0;
        wp_cache_replace_line('^ *\\$wp_supercache_cache_list', "\$wp_supercache_cache_list = " . $wp_supercache_cache_list . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_status'])) {
            if ($_POST['wp_cache_status'] == 'all') {
                wp_cache_enable();
            }
            if (isset($_POST['super_cache_enabled'])) {
                if ($_POST['super_cache_enabled'] == 0) {
                    wp_cache_enable();
                    wp_super_cache_disable();
                }
                if ($_POST['super_cache_enabled'] == 1) {
                    $wp_cache_mod_rewrite = 1;
                    // we need this because supercached files can be served by PHP too.
                } else {
                    $wp_cache_mod_rewrite = 0;
                }
                wp_cache_replace_line('^ *\\$wp_cache_mod_rewrite', '$wp_cache_mod_rewrite = ' . $wp_cache_mod_rewrite . ";", $wp_cache_config_file);
            }
        } else {
            wp_cache_disable();
        }
        if (isset($_POST['wp_cache_hello_world'])) {
            $wp_cache_hello_world = 1;
        } else {
            $wp_cache_hello_world = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_hello_world', '$wp_cache_hello_world = ' . $wp_cache_hello_world . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_clear_on_post_edit'])) {
            $wp_cache_clear_on_post_edit = 1;
        } else {
            $wp_cache_clear_on_post_edit = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_clear_on_post_edit', "\$wp_cache_clear_on_post_edit = " . $wp_cache_clear_on_post_edit . ";", $wp_cache_config_file);
        if (isset($_POST['cache_rebuild_files'])) {
            $cache_rebuild_files = 1;
        } else {
//.........这里部分代码省略.........
开发者ID:popovdenis,项目名称:kmst,代码行数:101,代码来源:wp-cache.php


示例7: wp_cache_manager_updates


//.........这里部分代码省略.........
        }
        wp_cache_replace_line('^ *\\$wp_supercache_304', "\$wp_supercache_304 = " . $wp_supercache_304 . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_mfunc_enabled'])) {
            $wp_cache_mfunc_enabled = 1;
        } else {
            $wp_cache_mfunc_enabled = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_mfunc_enabled', "\$wp_cache_mfunc_enabled = " . $wp_cache_mfunc_enabled . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_mobile_enabled'])) {
            $wp_cache_mobile_enabled = 1;
        } else {
            $wp_cache_mobile_enabled = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_mobile_enabled', "\$wp_cache_mobile_enabled = " . $wp_cache_mobile_enabled . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_front_page_checks'])) {
            $wp_cache_front_page_checks = 1;
        } else {
            $wp_cache_front_page_checks = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_front_page_checks', "\$wp_cache_front_page_checks = " . $wp_cache_front_page_checks . ";", $wp_cache_config_file);
        if (isset($_POST['wp_supercache_cache_list'])) {
            $wp_supercache_cache_list = 1;
        } else {
            $wp_supercache_cache_list = 0;
        }
        wp_cache_replace_line('^ *\\$wp_supercache_cache_list', "\$wp_supercache_cache_list = " . $wp_supercache_cache_list . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_status'])) {
            if ($_POST['wp_cache_status'] == 'all') {
                wp_cache_enable();
            }
            if (isset($_POST['super_cache_enabled'])) {
                if ($_POST['super_cache_enabled'] == 0) {
                    wp_cache_enable();
                    wp_super_cache_disable();
                }
                if ($_POST['super_cache_enabled'] == 1) {
                    $wp_cache_mod_rewrite = 1;
                    // we need this because supercached files can be served by PHP too.
                } else {
                    $wp_cache_mod_rewrite = 0;
                }
                wp_cache_replace_line('^ *\\$wp_cache_mod_rewrite', '$wp_cache_mod_rewrite = ' . $wp_cache_mod_rewrite . ";", $wp_cache_config_file);
            }
        } else {
            wp_cache_disable();
        }
        if (isset($_POST['wp_cache_hello_world'])) {
            $wp_cache_hello_world = 1;
        } else {
            $wp_cache_hello_world = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_hello_world', '$wp_cache_hello_world = ' . $wp_cache_hello_world . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_clear_on_post_edit'])) {
            $wp_cache_clear_on_post_edit = 1;
        } else {
            $wp_cache_clear_on_post_edit = 0;
        }
        wp_cache_replace_line('^ *\\$wp_cache_clear_on_post_edit', "\$wp_cache_clear_on_post_edit = " . $wp_cache_clear_on_post_edit . ";", $wp_cache_config_file);
        if (isset($_POST['cache_rebuild_files'])) {
            $cache_rebuild_files = 1;
        } else {
            $cache_rebuild_files = 0;
        }
        wp_cache_replace_line('^ *\\$cache_rebuild_files', "\$cache_rebuild_files = " . $cache_rebuild_files . ";", $wp_cache_config_file);
        if (isset($_POST['wp_cache_mutex_disabled'])) {
            $wp_cache_mutex_disabled = 0;
开发者ID:jordankoschei,项目名称:jordankoschei-dot-com,代码行数:67,代码来源:wp-cache.php


示例8: disable

 /**
  * Disable the WP Super Cache
  *
  * @param array $args
  * @param array $vars
  */
 function disable($args = array(), $vars = array())
 {
     if (function_exists('wp_super_cache_disable')) {
         global $super_cache_enabled;
         wp_super_cache_disable();
         if (!$super_cache_enabled) {
             WP_CLI::success('The WP Super Cache is disabled.');
         } else {
             WP_CLI::error('The WP Super Cache is still enabled, check its settings page for more info.');
         }
     } else {
         WP_CLI::error('The WP Super Cache could not be found, is it installed?');
     }
 }
开发者ID:bytewang,项目名称:wp-cli,代码行数:20,代码来源:wp-super-cache.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_suspend_cache_addition函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_styles函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap