[ad_1]
Hi, I need to test something (website loose permalinks sometimes) when i resave permalinks all works again.
Found this but that does not work as it own time interval
// Flush permalinks every hour
add_action(‘my_hourly_event’, ‘do_this_hourly’);
function my_activation() {
if ( !wp_next_scheduled( ‘my_hourly_event’ ) ) {
wp_schedule_event(time(), ‘hourly’, ‘my_hourly_event’);
}
}
add_action(‘wp’, ‘my_activation’);
function do_this_hourly() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
How do i create or what code must i use with your plugin ?
Thanks
