File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313require_once dirname ( __DIR__ ) . '/autoload.php ' ;
1414
15- if ( ! function_exists ( 'litespeed_oc_disable_ext_cache ' ) ) {
16- /**
17- * Disable external object cache flag.
18- *
19- * When called, WP's own set_transient/get_transient will use wp_options
20- * table instead of the (unavailable) OC backend.
21- *
22- * @since 7.8.0.1
23- * @access public
24- */
25- function litespeed_oc_disable_ext_cache () {
26- wp_using_ext_object_cache ( false );
27- }
28- }
29-
3015/**
3116 * Object cache handler using Redis or Memcached.
3217 *
@@ -594,9 +579,15 @@ private function _connect() {
594579 // After muplugins_loaded, all wp_start_object_cache() calls are done — safe to call directly.
595580 // Before that (early bootstrap), defer via hook to avoid multisite "Cannot redeclare" fatal.
596581 if ( function_exists ( 'did_action ' ) && did_action ( 'muplugins_loaded ' ) ) {
597- litespeed_oc_disable_ext_cache ( );
582+ wp_using_ext_object_cache ( false );
598583 } elseif ( function_exists ( 'add_action ' ) ) {
599- add_action ( 'muplugins_loaded ' , 'litespeed_oc_disable_ext_cache ' , -999 );
584+ add_action (
585+ 'muplugins_loaded ' ,
586+ function () {
587+ wp_using_ext_object_cache ( false );
588+ },
589+ -999
590+ );
600591 }
601592
602593 return false ;
Original file line number Diff line number Diff line change @@ -49,7 +49,13 @@ function wp_cache_init() {
4949 // and would try to load cache.php, causing "Cannot redeclare wp_cache_init()".
5050 // Defer until after all wp_start_object_cache() calls are done.
5151 if ( defined ( 'LITESPEED_OC_FAILURE ' ) ) {
52- add_action ( 'muplugins_loaded ' , 'litespeed_oc_disable_ext_cache ' , -999 );
52+ add_action (
53+ 'muplugins_loaded ' ,
54+ function () {
55+ wp_using_ext_object_cache ( false );
56+ },
57+ -999
58+ );
5359 }
5460}
5561
You can’t perform that action at this time.
0 commit comments