Rewrite permalinks | WordPress.org

[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

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer