Forums

wp_schedule_single_event not calling my function (3 posts)

  1. bugeyed
    Member
    Posted 2 years ago #

    Hi,

    I am using WP v2.9.2 and having an issue with wp_schedule_single_event not calling my intended function (mail sending). Using the wp-control plugin, I could see the cron entry. When I click on the "Do Now" link against the entry, it says that "Successfully executed the cron entry <my-function-name>" but I am not getting the mail (had separately tested the function). Any ideas what could be wrong here?

    Thanks in advance.

  2. bugeyed
    Member
    Posted 2 years ago #

    Anyone?

  3. afEkenholm
    Member
    Posted 1 year ago #

    The cron deamon uses do_action_ref_array does not invoke a function, but a hook! So if you want your function to be called you can either add an action with the same name:

    add_action( 'my_function_name', 'my_function_name' );

    or create a new action:

    add_action( 'my_cron_hook', 'my_function_name' );

Topic Closed

This topic has been closed to new replies.

About this Topic