File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -341,19 +341,10 @@ function truncate_excerpt_length($length)
341
341
// Clear cache on options save
342
342
function clear_cache_options_save ($ post_id )
343
343
{
344
- $ screen = get_current_screen ();
345
-
346
- if (strpos ($ screen ->id , 'general-options ' ) == true && $ post_id == 'general-options ' ) {
347
- // Clear object cache
348
- wp_cache_flush ();
349
-
350
- // Check if class WpeCommon exists
351
- if (class_exists ('\WpeCommon ' )) {
352
- error_log ('WpeCommon exists ' );
353
-
354
- WpeCommon::purge_memcached ();
355
- WpeCommon::purge_varnish_cache ();
356
- }
357
- }
344
+ // Check if it's an options page
345
+ if ($ post_id === 'options ' ) {
346
+ // Flush the object cache
347
+ wp_cache_flush ();
348
+ }
358
349
}
359
350
add_action ('acf/save_post ' , __NAMESPACE__ . '\\clear_cache_options_save ' , 20 );
You can’t perform that action at this time.
0 commit comments