WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

Your Answer


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.