So, here is my entire code in wp_content/plugins/my_plugin/my_plugin.php :
register_activation_hook(__FILE__, 'comunity_mails_activation'); add_action('check_mails_to_send', 'do_this_daily'); register_deactivation_hook(__FILE__, 'comunity_mails_deactivation'); function comunity_mails_activation() { wp_schedule_event(time(), 'daily', 'check_mails_to_send'); } function comunity_mails_deactivation() { wp_clear_scheduled_hook('check_mails_to_send'); } function do_this_daily() { wp_mail("[email protected]", "Automated Email", "Hell yeah it works!"); } When I do echo date("d-m-Y H:i:s",wp_next_scheduled('check_mails_to_send')); in the functions.php of my theme, it prints 13-02-2013 14:22:03
So I tried to do this :
do_action('ckeck_mails_to_send'); And my mail was sent. So I wonder, do I have to unschedule the task and schedule it again for the next day and compare the two timestamps and ... sounds silly...
I just don't understand why the mail has not been sent and why it's not scheduling it for the next day.
Thanks for reading/helping =D
define(DISABLE_WP_CON,true);somewhere in the code. Sorry... ^_^'