PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 1.7.2
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v1.7.2
2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 0.0.2 0.0.3 All 96 releases
sureforms / inc / activator.php
activator.php
50 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Sureforms flush rewrite rules.
4 *
5 * @package sureforms.
6 * @since 0.0.1
7 */
8
9 namespace SRFM\Inc;
10
11 use SRFM\Inc\Global_Settings\Email_Summary;
12 use SRFM\Inc\Traits\Get_Instance;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17
18 /**
19 * Activation Class.
20 *
21 * @since 0.0.1
22 */
23 class Activator {
24 use Get_Instance;
25
26 /**
27 * Activation handler function.
28 *
29 * @since 0.0.1
30 * @return void
31 */
32 public static function activate() {
33 $email_summary_options = get_option( 'srfm_email_summary_settings_options' );
34 $enable_email_summary = is_array( $email_summary_options ) ? $email_summary_options['srfm_email_summary'] : '';
35
36 if ( $enable_email_summary ) {
37 Email_Summary::schedule_weekly_entries_email();
38 }
39
40 /**
41 * Reset rewrite rules to avoid go to permalinks page
42 * through deleting the database options to force WP to do it
43 * because of on activation not work well flush_rewrite_rules()
44 */
45 delete_option( 'rewrite_rules' );
46
47 update_option( '__srfm_do_redirect', true );
48 }
49 }
50