1
I have the following function created in my functions.php. I’m changing the theme to schedule, and I can see that it’s scheduled by the function of next_schedule
.
add_action( 'after_switch_theme', 'prefix_setup_schedule' );
function prefix_setup_schedule() {
if ( ! wp_next_scheduled( 'sendemail' ) ) {
$timeschedule = strtotime(date("Y-m-d 18:00:00"));
wp_schedule_event( $timeschedule, 'daily', 'sendemail');
}
}
function sendemail()
{
update_option('envioemail','feito');
}
However, this code is not running, does anyone have any idea?
Caio, if you want to publish a reply in your own name, let me know and I will remove this.
– brasofilo