In my plugin I'm able to set a cron event like so:

wp_schedule_event(time(), 'daily', 'myhookname');

But want I want to do is be able to find out what recurrence I have set for myhookname.

The reason why is that I'm offering a setting to allow the recurrence to be changed. What I need to do is check if the recurrence setting has changed from what its currently set as and if so remove the event and reschedule the event with the new recurrence.

So if there a function like this:

$recurrence = wp_current_event_recurrence('myhookname'); // returns hourly/daily/etc
link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

I think I've found it: wp_get_schedule('myhookname')

Edit: yes this works as I want it.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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