Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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("my@email.net", "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

share|improve this question
    
Well, as I was working on an existing site which as maaaaany plugins already installed, I figured out that there was a define(DISABLE_WP_CON,true); somewhere in the code. Sorry... ^_^' –  Antoine Guillien Feb 13 '13 at 21:04
add comment

1 Answer

Well, as I was working on an existing site which as maaaaany plugins already installed, I figured out that there was a define(DISABLE_WP_CON,true);

So when you seems to have the same problem than me. Do a research of define(DISABLE_WP_CON,true); in you files.

Sorry... ^_^'

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.