shtrihstr / wp-flush-cache
帮助清除不同类型的缓存。
2.3.1
2020-12-30 15:42 UTC
Requires
- php: >=7.1
- composer/installers: ~1.0
This package is not auto-updated.
Last update: 2024-09-18 18:13:25 UTC
README
描述
帮助清除不同类型的缓存。
安装
-
首选方式是使用Composer
composer require innocode-digital/wp-flush-cache
默认情况下,它将被安装为必用插件。可以通过在
composer.json
中使用extra.installer-paths
来控制。 -
另一种方式是将此仓库克隆到
wp-content/mu-plugins/
或wp-content/plugins/
cd wp-content/plugins/ git clone git@github.com:innocode-digital/wp-flush-cache.git cd wp-flush-cache/ composer install
如果插件作为常规插件安装,则从插件页面或使用WP-CLI激活Flush Cache Buttons:wp plugin activate wp-flush-cache
。
使用方法
从插件添加了在网站使用持久缓存时清除对象缓存的功能,如果不使用,则清除瞬态。
注意
在网络中,可以从网络管理区域清除全局缓存,以及从每个站点的管理区域清除个别缓存。此外,还可以在网络管理区域的网站列表中清除个别缓存。
文档
在站点管理区域添加带有回调的清除按钮:/wp-admin/tools.php?page=innocode_cache-control
(工具 -> 缓存)。
flush_cache_add_button( string $title, callable $callback, string $description = '' );
在网络管理区域添加带有回调的清除按钮:/wp-admin/network/admin.php?page=innocode_cache-control
。
flush_cache_add_network_button( string $title, callable $callback, string $description = '' );
在网络管理区域的网站列表中添加带有回调的操作链接:/wp-admin/network/sites.php
。
flush_cache_add_sites_action_link( string $title, callable $callback, string $description = '' );