Hi,
thanks, yes, that is what I need.
I’ve just some 50 post to sort, so I guess it is okay.
How can I change an option via a scheduled event?
Can I do it like this in the functions.php of the theme?
add_action( 'wp', 'prefix_setup_schedule' );
/**
* On an early action hook, check if the hook is scheduled - if not, schedule it.
*/
function prefix_setup_schedule() {
if ( ! wp_next_scheduled( 'prefix_hourly_event' ) ) {
wp_schedule_event( time(), 'hourly', 'prefix_hourly_event');
}
}
add_action( 'prefix_hourly_event', 'prefix_do_this_hourly' );
/**
* On the scheduled action hook, run a function.
*/
function prefix_do_this_hourly() {
// do something every hour
}
thanks