File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,17 +18,17 @@ public static function get_object( $key = null, $callback ) {
1818 $ object_cache_expire = self ::$ settings ['object_cache_expire ' ] ?: 86400 ; // Default to 24 hours of null
1919
2020 // Set key variable
21- $ object_cache_key = self :: $ prefix . ' _ ' . $ key . ( is_multisite () ? '_ ' . get_current_blog_id () : '' );
21+ $ object_cache_key = $ key . ( is_multisite () ? '_ ' . get_current_blog_id () : '' );
2222
2323 // Try to get the value of the cache
2424 $ result = wp_cache_get ( $ object_cache_key , $ object_cache_group );
25- if ( is_serialized ($ result ) ) $ result = unserialize ($ result );
25+ if ( $ result && is_serialized ( $ result ) ) $ result = unserialize ($ result );
2626
2727 // If result wasn't found/returned and/or caching is disabled, set & return the value from $callback
28- if (!$ result ) {
28+ if (true || !$ result ) {
2929 $ result = $ callback ();
30- if ( is_array ( $ result ) || is_object ( $ result ) ) $ result = serialize ( $ result );
31- wp_cache_set ( $ object_cache_key , $ result , $ object_cache_group , $ object_cache_expire );
30+ if ( is_array ( $ result ) || is_object ( $ result ) ) $ set_result = serialize ( $ result );
31+ wp_cache_set ( $ object_cache_key , $ set_result , $ object_cache_group , $ object_cache_expire );
3232 }
3333
3434 return $ result ;
@@ -58,7 +58,7 @@ public static function flush($ID = null, $post = null) {
5858
5959 if ( defined ('DOING_AJAX ' ) && DOING_AJAX ) {
6060 echo json_encode ($ result );
61- wp_die ();
61+ die ();
6262 }
6363 return $ result ['success ' ];
6464
You can’t perform that action at this time.
0 commit comments