Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Notes: The wp_cron job will take over the calculation of the results if 5 seconds is not long enough at the time of form submission/update.
- The default schedule is set to hourly to avoid heavy loads on the server but the frequency can be changed by using the gform_polls_cron_schedule filter.
- The format follows the same format required by the WordPress cron_schedules filter. http://codex.wordpress.org/Function_Reference/wp_get_schedules
- ** Important: the Polls Add-On must be deactivated and reactivated in order to reschedule the task.
- Example usage:
- add_filter( 'gform_polls_cron_schedule', 'cron_add_twice_hourly' );
- function cron_add_twice_hourly() {
- // Adds once weekly to the existing schedules.
- $schedule['twicehourly'] = array(
- 'interval' => 1800, // number of seconds in the interval
- 'display' => __( 'Twice Hourly' )
- );
- return $schedule;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement