PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.0
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Core / Util / Deactivation.php

Deactivation.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 2.0, at includes/Core/Util/Deactivation.php

35 lines 778 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Core\Util;
4
5 /**
6 * Class handling plugin deactivation.
7 *
8 * @since 1.0.0
9 * @access private
10 * @ignore
11 */
12 final class Deactivation {
13 /**
14 * Registers functionality through WordPress hooks.
15 *
16 * @since 1.0.0
17 */
18 public function register() {
19 add_action('bitforms_deactivation', [$this, 'deactive']);
20 }
21
22 public function deactive() {
23 $routes = get_option('bitforms_routes');
24 if ($routes && isset($routes['root'])) {
25 $root_page = ['ID' => $routes['root'], 'post_status' => 'draft'];
26 wp_update_post($root_page);
27 }
28 if ($routes && isset($routes['file'])) {
29 $file_page = ['ID' => $routes['file'], 'post_status' => 'draft'];
30 wp_update_post($file_page);
31 }
32 flush_rewrite_rules();
33 }
34 }
35