PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.49
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.49
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / admin / settings / class-uwp-settings-uninstall.php

class-uwp-settings-uninstall.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.2.49, at admin/settings/class-uwp-settings-uninstall.php

109 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * UsersWP Uninstall Settings
4 *
5 * @author AyeCode
6 * @category Admin
7 * @package userswp/Admin
8 * @version 1.0.24
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 if ( ! class_exists( 'UsersWP_Settings_Uninstall', false ) ) {
16
17 /**
18 * UsersWP_Settings_Uninstall.
19 */
20 class UsersWP_Settings_Uninstall extends UsersWP_Settings_Page {
21
22 /**
23 * Constructor.
24 */
25 public function __construct() {
26
27 $this->id = 'uninstall';
28 $this->label = __( 'Uninstall', 'userswp' );
29
30 add_filter( 'uwp_settings_tabs_array', array( $this, 'add_settings_page' ), 99 );
31 add_action( 'uwp_settings_' . $this->id, array( $this, 'output' ) );
32 add_action( 'uwp_sections_' . $this->id, array( $this, 'output_toggle_advanced' ) );
33 add_action( 'uwp_settings_save_' . $this->id, array( $this, 'save' ) );
34 add_action( 'uwp_sections_' . $this->id, array( $this, 'output_sections' ) );
35
36 }
37
38 /**
39 * Output the settings.
40 */
41 public function output() {
42 global $current_section;
43
44 $settings = $this->get_settings( $current_section );
45
46 UsersWP_Admin_Settings::output_fields( $settings );
47 }
48
49 /**
50 * Save settings.
51 */
52 public function save() {
53 global $current_section;
54
55 $settings = $this->get_settings( $current_section );
56 UsersWP_Admin_Settings::save_fields( $settings );
57 }
58
59 /**
60 * Get sections.
61 *
62 * @return array
63 */
64 public function get_sections() {
65
66 $sections = array(
67 '' => __( 'Uninstall Settings', 'userswp' ),
68 );
69
70 return apply_filters( 'uwp_get_sections_' . $this->id, $sections );
71 }
72
73 public function get_settings( $current_section = '' ) {
74
75 /**
76 * Filter uninstall settings array.
77 *
78 * @package userswp
79 */
80 $settings = apply_filters( 'uwp_uninstall_options', array(
81 array(
82 'title' => __( 'Uninstall Settings', 'userswp' ),
83 'type' => 'title',
84 'desc' => '<b style="color:#f00 ">' . __( 'NOTE: Add-ons should be deleted before core to ensure complete uninstall.', 'userswp' ) . '</b>',
85 'id' => 'uninstall_options',
86 ),
87
88 array(
89 'name' => __( 'Remove Data on Uninstall?', 'userswp' ),
90 'desc' => __( 'Check this box if you would like UsersWP to completely remove all of its data when the plugin is deleted.', 'userswp' ),
91 'id' => 'uninstall_erase_data',
92 'type' => 'checkbox',
93 ),
94
95 ) );
96
97 $settings = apply_filters( 'uwp_get_settings_' . $this->id, $settings );
98
99 $settings[] = array( 'type' => 'sectionend', 'id' => 'uninstall_options' );
100
101 return $settings;
102 }
103
104 }
105
106 }
107
108 return new UsersWP_Settings_Uninstall();
109