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.

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
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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

Edit: yes this works as I want it.

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.