PluginProbe
Prismatic / 1.9
Prismatic v1.9
trunk 1.3 1.4 1.5 1.6 1.6.1 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.9.1 3.0 3.1 3.1.1 3.2 3.2.1 All 40 releases
prismatic / inc / settings-reset.php

settings-reset.php in Prismatic 1.9, at inc/settings-reset.php

59 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // Prismatic - Reset Settings
2
3 if (!defined('ABSPATH')) exit;
4
5 function prismatic_admin_notice() {
6
7 $screen = get_current_screen();
8
9 if ($screen->id === 'settings_page_prismatic') {
10
11 if (isset($_GET['reset-options'])) {
12
13 if ($_GET['reset-options'] === 'true') : ?>
14
15 <div class="notice notice-success is-dismissible"><p><strong><?php esc_html_e('Default options restored.', 'prismatic'); ?></strong></p></div>
16
17 <?php else : ?>
18
19 <div class="notice notice-info is-dismissible"><p><strong><?php esc_html_e('No changes made to options.', 'prismatic'); ?></strong></p></div>
20
21 <?php endif;
22
23 }
24
25 }
26
27 }
28
29 function prismatic_reset_options() {
30
31 if (isset($_GET['reset-options-verify']) && wp_verify_nonce($_GET['reset-options-verify'], 'prismatic_reset_options')) {
32
33 if (!current_user_can('manage_options')) exit;
34
35 $update_general = update_option('prismatic_options_general', Prismatic::options_general());
36 $update_prism = update_option('prismatic_options_prism', Prismatic::options_prism());
37 $update_highlight = update_option('prismatic_options_highlight', Prismatic::options_highlight());
38 $update_plain = update_option('prismatic_options_plain', Prismatic::options_plain());
39
40 $result = 'false';
41
42 if (
43 $update_general ||
44 $update_prism ||
45 $update_highlight ||
46 $update_plain
47
48 ) $result = 'true';
49
50 $location = admin_url('options-general.php?page=prismatic&reset-options='. $result);
51
52 wp_redirect($location);
53
54 exit;
55
56 }
57
58 }
59