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

47 lines 719 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 );
28 }
29
30
31 /**
32 * Removes all cron events.
33 *
34 * @since 6.3.2
35 */
36 public static function remove_crons() {
37 $events = self::get_events();
38
39 foreach ( $events as $event => $recurrence ) {
40 $timestamp = wp_next_scheduled( $event );
41 if ( false !== $timestamp ) {
42 wp_unschedule_event( $timestamp, $event );
43 }
44 }
45 }
46 }
47