Get frequency of scheduled event

This is an old question, but hopefully this helps someone facing the same issue.

We can use wp_get_schedule( $hook ) to retrieve the cron schedule for the hook. Then we can use wp_get_schedules() to retrieve the supported cron recurrences. Find the correct array value and return it.

/**
 * Retrieve Cron interval for hook.
 *
 * @param string $hook Action hook to execute when cron is run.
 * @return int|false False, if no schedule. Interval on success.
 */
if( ! function_exists( 'wp_get_scheduled_event_frequency' ) ):
function wp_get_scheduled_event_frequency( $hook ) {
  $schedule  = wp_get_schedule( $hook );
  $schedules = wp_get_schedules();
  return isset( $schedules[ $schedule ] ) ? $schedules[ $schedule ][ 'interval' ] : false;
}
endif;

Leave a Comment