abilities
1 week ago
admin
1 month ago
ai-form-builder
1 week ago
blocks
1 month ago
compatibility
3 weeks ago
database
3 weeks ago
email
3 months ago
fields
3 weeks ago
global-settings
1 week ago
lib
1 week ago
migrator
3 weeks ago
page-builders
3 weeks ago
payments
1 week ago
single-form-settings
1 month ago
traits
1 month ago
activator.php
1 year ago
admin-ajax.php
3 weeks ago
background-process.php
8 months ago
create-new-form.php
2 months ago
duplicate-form.php
1 month ago
entries.php
3 weeks ago
events-scheduler.php
2 years ago
export.php
1 month ago
field-validation.php
1 week ago
form-restriction.php
1 month ago
form-styling.php
3 months ago
form-submit.php
3 weeks ago
forms-data.php
3 months ago
frontend-assets.php
1 week ago
generate-form-markup.php
3 weeks ago
gutenberg-hooks.php
1 month ago
helper.php
3 weeks ago
learn.php
3 months ago
onboarding.php
1 month ago
post-types.php
1 month ago
rest-api.php
1 week ago
smart-tags.php
2 months ago
submit-token.php
3 months ago
translatable.php
1 week ago
updater-callbacks.php
1 year ago
updater.php
1 year ago
activator.php
50 lines
| 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 |