PluginProbe
Customify / 2.3.0
Customify v2.3.0
2.10.9 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.7.1 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.6.0 1.6.0.1 1.6.5 1.7.0 1.7.1 All 77 releases
customify / views / form-partials / fields / reset_theme_mod.php

reset_theme_mod.php in Customify 2.3.0, at views/form-partials/fields/reset_theme_mod.php

65 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined( 'ABSPATH' ) or die;
2 /* @var PixCustomifyFormField $field */
3 /* @var PixCustomifyForm $form */
4 /* @var mixed $default */
5 /* @var string $name */
6 /* @var string $idname */
7 /* @var string $label */
8 /* @var string $desc */
9 /* @var string $rendering */
10
11 // [!!] the counter field needs to be able to work inside other fields; if
12 // the field is in another field it will have a null label
13
14 $selected = $form->autovalue( $name, $default );
15
16 $config = apply_filters('customify_filter_fields', array() );
17
18 $key = $config[ 'opt-name' ];
19
20 $mods = get_theme_mods();
21
22 $option = get_option( 'pixcustomify_settings' );
23
24 $attrs = array(
25 'type' => 'checkbox',
26 ); ?>
27 <div class="reset_customify_theme_mod">
28 <div class="button" id="reset_theme_mods"><?php esc_html_e( 'Reset Theme Mods', 'customify' ); ?></div>
29 <script>
30 (function ($) {
31 $(document).ready(function () {
32 $('#reset_theme_mods').on('click', function () {
33 var confirm = window.confirm('Are you sure?');
34
35 if ( ! confirm ) {
36 return false;
37 }
38
39 $.ajax({
40 url: customify_settings.wp_rest.root + 'customify/v1/delete_theme_mod',
41 method: 'POST',
42 beforeSend: function (xhr) {
43 xhr.setRequestHeader('X-WP-Nonce', customify_settings.wp_rest.nonce);
44 },
45 data: {
46 'customify_settings_nonce': customify_settings.wp_rest.customify_settings_nonce
47 }
48 }).done(function (response) {
49 if ( response.success ) {
50 alert( 'Success: ' + response.data );
51 } else {
52 alert( 'No luck: ' + response.data );
53 }
54 }).error(function (e) {
55 console.log(e);
56 });
57 });
58 });
59
60 })(jQuery)
61 </script>
62 </div>
63 <br>
64 <div class="field-desc"><?php esc_html_e('Resets all the Customizer settings introduced by the plugin. It will NOT reset core Customizer settings or plugin settings.'); ?></div>
65