Shortcodes by Angie Makes - Version 3.30

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Shortcodes by Angie Makes
Version 3.30
Comparing to
See all releases

Code changes from version 3.29 to 3.30

README.md CHANGED
@@ -106,6 +106,11 @@ See our help article on [how to manually upload a plugin](http://knowledgebase.a
106
 
107
  ## Changelog ##
108
 
 
 
 
 
 
109
  ### Version 3.29 ###
110
 
111
  * allowed sanitation of multiple pixel values
106
 
107
  ## Changelog ##
108
 
109
+ ### Version 3.30 ###
110
+
111
+ * fixed bug with accordion not closing
112
+ * Added reset button
113
+
114
  ### Version 3.29 ###
115
 
116
  * allowed sanitation of multiple pixel values
includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php CHANGED
@@ -68,6 +68,7 @@ class WC_Shortcodes_Settings_Framework {
68
  $this->set_slug_prefix();
69
 
70
  add_action( 'admin_init', array( &$this, 'set_plugin_info' ) );
 
71
 
72
  add_action( 'init', array( &$this, 'set_options' ), 100 );
73
  add_action( 'admin_init', array( &$this, 'register_settings' ) );
@@ -97,6 +98,17 @@ class WC_Shortcodes_Settings_Framework {
97
  return self::$instance;
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
 
100
  public function set_slug_prefix() {
101
  $plugin_basename = plugin_basename( __FILE__ );
102
  $plugin_name = substr( $plugin_basename, 0, strpos( $plugin_basename, '/' ) );
@@ -179,6 +191,57 @@ class WC_Shortcodes_Settings_Framework {
179
  }
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  public function update_option( $option_name, $default ) {
183
  update_option( $option_name, $default );
184
  }
68
  $this->set_slug_prefix();
69
 
70
  add_action( 'admin_init', array( &$this, 'set_plugin_info' ) );
71
+ add_action( 'admin_init', array( &$this, 'reset_options' ) );
72
 
73
  add_action( 'init', array( &$this, 'set_options' ), 100 );
74
  add_action( 'admin_init', array( &$this, 'register_settings' ) );
98
  return self::$instance;
99
  }
100
 
101
+ public function reset_options() {
102
+ if ( isset( $_POST['wpcsf_reset_options_' . $this->plugin_slug ] ) ) {
103
+ $this->reset_all_options();
104
+ add_settings_error( $menu_slug, 'settings_updated', __('Settings reset.'), 'updated' );
105
+ set_transient('settings_errors', get_settings_errors(), 30);
106
+ $goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );
107
+ wp_redirect( $goback );
108
+ exit;
109
+ }
110
+ }
111
+
112
  public function set_slug_prefix() {
113
  $plugin_basename = plugin_basename( __FILE__ );
114
  $plugin_name = substr( $plugin_basename, 0, strpos( $plugin_basename, '/' ) );
191
  }
192
  }
193
 
194
+ public function reset_all_options() {
195
+ $this->set_options();
196
+
197
+ if ( true ) {
198
+ foreach ( $this->options as $menu_slug => $o ) {
199
+ if ( isset( $o['option_group'] ) ) {
200
+ if ( isset( $o['tabs'] ) &&
201
+ is_array( $o['tabs'] ) ) {
202
+ foreach( $o['tabs'] as $key => $oo ) {
203
+ if ( isset( $oo['sections'] ) &&
204
+ is_array( $oo['sections'] ) ) {
205
+ $this->loop_and_reset_all_options( $oo['sections'] );
206
+ }
207
+ }
208
+ }
209
+ else if ( isset( $o['sections'] ) &&
210
+ is_array( $o['sections'] ) ) {
211
+ $this->loop_and_reset_all_options( $o['sections'] );
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ }
218
+
219
+ public function loop_and_reset_all_options( $sections ) {
220
+ foreach( $sections as $o ) {
221
+ if ( isset( $o['id'] ) &&
222
+ isset( $o['title'] ) &&
223
+ isset( $o['options'] ) &&
224
+ is_array( $o['options'] ) ) {
225
+ foreach( $o['options'] as $oo ) {
226
+ if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
227
+ foreach ( $oo['group'] as $key => $ooo ) {
228
+ if ( isset( $ooo['option_name'] ) ) {
229
+ $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
230
+ $this->update_option( $ooo['option_name'], $ooo['default'] );
231
+ }
232
+ }
233
+ }
234
+ else {
235
+ if ( isset( $oo['option_name'] ) ) {
236
+ $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
237
+ $this->update_option( $oo['option_name'], $oo['default'] );
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+ }
244
+
245
  public function update_option( $option_name, $default ) {
246
  update_option( $option_name, $default );
247
  }
includes/vendors/wpc-settings-framework/css/options.css CHANGED
@@ -151,3 +151,22 @@
151
  .wpcsf-group .wpcsf-input-field .description {
152
  display: inline-block;
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  .wpcsf-group .wpcsf-input-field .description {
152
  display: inline-block;
153
  }
154
+ /**
155
+ * Reset Button
156
+ */
157
+ .wpcsf-wrap .button.delete {
158
+ float: right;
159
+ }
160
+ @media screen and (max-width: 600px) {
161
+ .wpcsf-wrap #submit {
162
+ display: block;
163
+ float: left;
164
+ clear: both;
165
+ }
166
+ .wpcsf-wrap .button.delete {
167
+ float: left;
168
+ display: block;
169
+ margin-top: 1.5em;
170
+ clear: both;
171
+ }
172
+ }
includes/vendors/wpc-settings-framework/views/page.php CHANGED
@@ -24,7 +24,7 @@
24
 
25
  <p class="submit">
26
  <?php submit_button( null, 'primary', 'submit', false ); ?>
27
- <?php //submit_button( 'Restore Default Settings', 'delete', 'submit', false ); ?>
28
  </p>
29
  </form>
30
  </div>
24
 
25
  <p class="submit">
26
  <?php submit_button( null, 'primary', 'submit', false ); ?>
27
+ <?php submit_button( 'Restore Default Settings', 'delete', 'wpcsf_reset_options_' . $menu_slug, false, array( 'onclick' => 'return confirm("Are you sure you want to reset your settings?");' ) ); ?>
28
  </p>
29
  </form>
30
  </div>
includes/vendors/wpc-settings-framework/views/settings-error.php CHANGED
@@ -1,10 +1,5 @@
1
  <?php
2
  wp_reset_vars( array( 'action' ) );
3
 
4
- if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
5
- // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
6
- add_settings_error( $menu_slug, 'settings_updated', __('Settings saved.'), 'updated' );
7
- }
8
-
9
  settings_errors();
10
  ?>
1
  <?php
2
  wp_reset_vars( array( 'action' ) );
3
 
 
 
 
 
 
4
  settings_errors();
5
  ?>
includes/vendors/wpc-settings-framework/views/tabs.php CHANGED
@@ -86,7 +86,7 @@ if ( empty( $active_tab ) && isset( $_COOKIE[ $cookie_name ] ) && ! empty( $_COO
86
 
87
  <p class="submit">
88
  <?php submit_button( null, 'primary', 'submit', false ); ?>
89
- <?php //submit_button( 'Restore Default Settings', 'delete', 'submit', false ); ?>
90
  </p>
91
  </form>
92
  </div>
86
 
87
  <p class="submit">
88
  <?php submit_button( null, 'primary', 'submit', false ); ?>
89
+ <?php submit_button( 'Restore Default Settings', 'delete', 'wpcsf_reset_options_' . $menu_slug, false, array( 'onclick' => 'return confirm("Are you sure you want to reset your settings?");' ) ); ?>
90
  </p>
91
  </form>
92
  </div>
public/assets/js/accordion.js CHANGED
@@ -54,7 +54,7 @@
54
  $content.not($next).animate({height:0},'fast','linear');
55
  }
56
  else {
57
- $this.addClass('wc-shortcodes-accordion-header-active');
58
  }
59
 
60
  }
54
  $content.not($next).animate({height:0},'fast','linear');
55
  }
56
  else {
57
+ $next.animate({height:0},'fast','linear');
58
  }
59
 
60
  }
public/class-vars.php CHANGED
@@ -8,7 +8,7 @@ class WPC_Shortcodes_Vars {
8
  *
9
  * @var string
10
  */
11
- const VERSION = '3.29';
12
  const DB_VERSION = '1.0';
13
 
14
  /**
8
  *
9
  * @var string
10
  */
11
+ const VERSION = '3.30';
12
  const DB_VERSION = '1.0';
13
 
14
  /**
readme.txt CHANGED
@@ -113,6 +113,11 @@ See our help article on [how to manually upload a plugin](http://knowledgebase.a
113
 
114
  == Changelog ==
115
 
 
 
 
 
 
116
  = Version 3.29 =
117
 
118
  * allowed sanitation of multiple pixel values
113
 
114
  == Changelog ==
115
 
116
+ = Version 3.30 =
117
+
118
+ * fixed bug with accordion not closing
119
+ * Added reset button
120
+
121
  = Version 3.29 =
122
 
123
  * allowed sanitation of multiple pixel values
wc-shortcodes.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://angiemakes.com/feminine-wordpress-blog-themes-women/
5
  Description: A plugin that adds a useful family of shortcodes to your WordPress theme.
6
  Author: Chris Baldelomar
7
  Author URI: http://angiemakes.com/
8
- Version: 3.29
9
  License: GPLv2 or later
10
  */
11
 
5
  Description: A plugin that adds a useful family of shortcodes to your WordPress theme.
6
  Author: Chris Baldelomar
7
  Author URI: http://angiemakes.com/
8
+ Version: 3.30
9
  License: GPLv2 or later
10
  */
11