How to purge ls cache by wp-cron?
-
We tried this code, but it doesn’t seems to affect.
// Remove srcset add_filter('wp_calculate_image_srcset_meta', '__return_false'); // Register a new cron schedule with 86400 seconds interval add_filter('cron_schedules', 'add_ligetpost_cron_schedule'); function add_ligetpost_cron_schedule($schedules) { if (!isset($schedules["ligetpost_daily"])) { $schedules['ligetpost_daily'] = array( 'interval' => 86400, 'display' => esc_html__('Ligetpost Every Day'), ); } return $schedules; } if (!wp_next_scheduled('ligetpost_daily')) { wp_schedule_event(strtotime('00:06:00 Europe/Budapest'), 'ligetpost_daily', 'ligetpost_daily'); } // Now let's hook it up with our function add_action('ligetpost_daily', 'clear_litespeed_cache'); function clear_litespeed_cache() { if (class_exists('\LiteSpeed\Purge')) { \LiteSpeed\Purge::purge_all(); } }
After that I checked your plugin and I found this code.
$this->_purge_all_lscache();
How could I call this function in my function.php?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘How to purge ls cache by wp-cron?’ is closed to new replies.