PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmCronController.php +26 -3 6.5.2 → trunk View file →
@@ -2,8 +2,10 @@
2 2 /**
3 3 * Cron controller
4 4 *
5 5 * @since 6.3.2
6 + *
7 + * @package Formidable
6 8 */
7 9
8 10 if ( ! defined( 'ABSPATH' ) ) {
9 11 die( 'You are not allowed to call this page directly.' );
@@ -23,13 +25,35 @@
23 25 */
24 26 private static function get_events() {
25 27 return array(
26 28 'formidable_send_usage' => 'weekly',
29 + 'frm_daily_event' => 'daily',
27 30 'frm_payment_cron' => 'daily',
28 31 );
29 32 }
30 33
31 34 /**
35 + * Schedules cron events.
36 + *
37 + * @since 6.7
38 + *
39 + * @return void
40 + */
41 + public static function schedule_events() {
42 + $events = self::get_events();
43 +
44 + // These are scheduled in another place.
45 + unset( $events['formidable_send_usage'] );
46 + unset( $events['frm_payment_cron'] );
47 +
48 + foreach ( $events as $event => $recurrence ) {
49 + if ( ! wp_next_scheduled( $event ) ) {
50 + wp_schedule_event( time(), $recurrence, $event );
51 + }
52 + }
53 + }
54 +
55 + /**
32 56 * Removes all cron events.
33 57 *
34 58 * @since 6.3.2
35 59 *
@@ -35,12 +59,11 @@
35 59 *
36 60 * @return void
37 61 */
38 62 public static function remove_crons() {
39 - $events = self::get_events();
63 + foreach ( self::get_events() as $event => $recurrence ) {
64 + $timestamp = wp_next_scheduled( $event );
40 65
41 - foreach ( $events as $event => $recurrence ) {
42 - $timestamp = wp_next_scheduled( $event );
43 66 if ( false !== $timestamp ) {
44 67 wp_unschedule_event( $timestamp, $event );
45 68 }
46 69 }