PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.5
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
formidable / classes / controllers / FrmCronController.php

FrmCronController.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.5, at classes/controllers/FrmCronController.php

49 lines 778 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Cron controller
4 *
5 * @since 6.3.2
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 die( 'You are not allowed to call this page directly.' );
10 }
11
12 /**
13 * Class FrmCronController
14 */
15 class FrmCronController {
16
17 /**
18 * Gets all cron events.
19 *
20 * @since 6.3.2
21 *
22 * @return string[]
23 */
24 private static function get_events() {
25 return array(
26 'formidable_send_usage' => 'weekly',
27 'frm_payment_cron' => 'daily',
28 );
29 }
30
31 /**
32 * Removes all cron events.
33 *
34 * @since 6.3.2
35 *
36 * @return void
37 */
38 public static function remove_crons() {
39 $events = self::get_events();
40
41 foreach ( $events as $event => $recurrence ) {
42 $timestamp = wp_next_scheduled( $event );
43 if ( false !== $timestamp ) {
44 wp_unschedule_event( $timestamp, $event );
45 }
46 }
47 }
48 }
49