| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | |
| 4 | 4 | class ObjectCachePro extends berqIntegrations { |
| 5 | 5 | function __construct() { |
| 6 | 6 | add_action('berqwp_flush_all_cache', [$this, 'flush_cache']); |
| 7 | - add_action('berqwp_stored_page_cache', [$this, 'flush_cache']); | |
| 7 | + add_action('berqwp_stored_page_cache', [$this, 'flush_page_cache']); | |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | function flush_cache() |
| 11 | 11 | { |
| @@ -12,7 +12,14 @@ | ||
| 12 | 12 | if (function_exists('wp_cache_flush')) { |
| 13 | 13 | wp_cache_flush(); // Clear the entire object cache. |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | + | |
| 17 | + function flush_page_cache($slug) | |
| 18 | + { | |
| 19 | + if (function_exists('wp_cache_flush')) { | |
| 20 | + wp_cache_flush(); // Object cache has no per-URL concept; flush all on page store. | |
| 21 | + } | |
| 22 | + } | |
| 16 | 23 | } |
| 17 | 24 | |
| 18 | -new ObjectCachePro(); | |
| 25 | +new ObjectCachePro(); | |