Changeset 2223036
- Timestamp:
- 01/06/2020 06:43:33 PM (6 years ago)
- Location:
- stylebidet
- Files:
-
- 4 edited
-
tags/0.6.0/assets/vnm-admin.css (modified) (2 diffs)
-
tags/0.6.0/stylebidet.php (modified) (7 diffs)
-
trunk/assets/vnm-admin.css (modified) (2 diffs)
-
trunk/stylebidet.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
stylebidet/tags/0.6.0/assets/vnm-admin.css
r2222053 r2223036 6 6 */ 7 7 8 @import url('https://fonts.googleapis.com/css?family=Ubuntu:400,400i,500,500i');9 10 8 /* 11 9 ADMIN AREA … … 13 11 14 12 .vnmadmin-wrapper { 15 font-family: "Ubuntu", sans-serif;16 13 color: #2A3350; 17 14 } -
stylebidet/tags/0.6.0/stylebidet.php
r2222053 r2223036 11 11 Copyright (C) 2010-2020 Lawrie Malen // Very New Media 12 12 Created: 02-02-2010 13 Updated: 0 3-01-202013 Updated: 06-01-2020 14 14 15 15 */ … … 160 160 function vnmStyleBidet_settingsPage() { 161 161 162 // Let's get the options set in the db by default 163 164 $optionsArray = vnmStyleBidet_getOptions(); 165 166 // Let's check if any data has been posted 167 168 $shouldUpdate = false; 162 169 $updated = false; 163 164 // Let's get the options set in the db by default 165 166 $optionsArray = vnmStyleBidet_getOptions(); 170 $updateFailed = false; 171 172 if (isset($_REQUEST['updateVNMStyleBidetSettings'])) { 173 174 // Does the current user have permission to complete this action? 175 176 if (empty($_POST) || !check_admin_referer('vnm_stylebidet_nonce_action', 'stylebidet_admin_nonce') || !apply_filters('stylebidet_user_allowed', current_user_can('manage_options'))) { 177 $updateFailed = true; 178 } 179 180 // Does the nonce check pass? 181 182 if (isset($_POST['nonce']) && sanitize_html_class($_POST['action']) === 'stylebidet_update_settings' && wp_verify_nonce(sanitize_html_class($_POST['nonce']), 'stylebidet_update_settings')) { 183 $shouldUpdate = true; 184 } else { 185 $updateFailed = true; 186 } 187 } 167 188 168 189 foreach ($optionsArray as $option=>$value) { … … 170 191 // Save, if required 171 192 172 if ( isset($_REQUEST['updateVNMStyleBidetSettings'])) {193 if ($shouldUpdate) { 173 194 if (array_key_exists($option, $_POST)) { 174 if ( $_POST[$option]) {175 176 update_option('vnmStyleBidet_' . $option, 1); // We can assume it's 'on'195 if (isset($_POST[$option]) && sanitize_html_class($_POST[$option]) === 'on') { 196 197 update_option('vnmStyleBidet_' . $option, 1); // It's checked, so we switch the option on 177 198 178 199 } else { 179 200 180 update_option('vnmStyleBidet_' . $option, 0); // We can assume it's unchecked201 update_option('vnmStyleBidet_' . $option, 0); // It's unchecked, so switch the option off 181 202 182 203 } … … 258 279 <?php endif; ?> 259 280 281 <?php if ($updateFailed) : ?> 282 <section class="wrapper updated"> 283 <div class="padded-section"> 284 <span class="dashicons dashicons-warning notice-icon secondarycolor"></span> 285 <?php _e('Uh oh, it looks like you can\'t do that.', 'styebidet'); ?> 286 </div> 287 </section> 288 <?php endif; ?> 289 260 290 <?php 261 291 /// … … 277 307 <div class="padded-section"> 278 308 <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=vnmStyleBidetSettings" class="form" method="post"> 279 309 310 <input type="hidden" name="action" value="stylebidet_update_settings" /> 311 <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('stylebidet_update_settings'); ?>" /> 312 <?php wp_nonce_field('vnm_stylebidet_nonce_action','stylebidet_admin_nonce' ); ?> 313 280 314 <table class="form-table"> 281 315 … … 434 468 <div class="vnm-rating-request box"> 435 469 <?php 436 /*printf(470 printf( 437 471 __('Is StyleBidet making your life a little easier? %sWhy not leave us a %s review?%s %s', 'stylebidet'), 438 '<a href=" thing" target="_blank">',472 '<a href="https://wordpress.org/plugins/stylebidet/" target="_blank">', 439 473 '<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>', 440 474 '</a>', 441 475 '<span class="dashicons dashicons-smiley"></span>' 442 ); */476 ); 443 477 ?> 444 478 </div> … … 479 513 // Include htmLawed (this is pretty much only used for <font> & inline style tags 480 514 481 include_once('includes/htmlLawed.php'); 515 if (!function_exists('htmLawed')) { 516 include_once('includes/htmlLawed.php'); 517 } 482 518 483 519 // Adding a 'nonsense' value so that at lest there's something in the array -
stylebidet/trunk/assets/vnm-admin.css
r2222053 r2223036 6 6 */ 7 7 8 @import url('https://fonts.googleapis.com/css?family=Ubuntu:400,400i,500,500i');9 10 8 /* 11 9 ADMIN AREA … … 13 11 14 12 .vnmadmin-wrapper { 15 font-family: "Ubuntu", sans-serif;16 13 color: #2A3350; 17 14 } -
stylebidet/trunk/stylebidet.php
r2222053 r2223036 11 11 Copyright (C) 2010-2020 Lawrie Malen // Very New Media 12 12 Created: 02-02-2010 13 Updated: 0 3-01-202013 Updated: 06-01-2020 14 14 15 15 */ … … 160 160 function vnmStyleBidet_settingsPage() { 161 161 162 // Let's get the options set in the db by default 163 164 $optionsArray = vnmStyleBidet_getOptions(); 165 166 // Let's check if any data has been posted 167 168 $shouldUpdate = false; 162 169 $updated = false; 163 164 // Let's get the options set in the db by default 165 166 $optionsArray = vnmStyleBidet_getOptions(); 170 $updateFailed = false; 171 172 if (isset($_REQUEST['updateVNMStyleBidetSettings'])) { 173 174 // Does the current user have permission to complete this action? 175 176 if (empty($_POST) || !check_admin_referer('vnm_stylebidet_nonce_action', 'stylebidet_admin_nonce') || !apply_filters('stylebidet_user_allowed', current_user_can('manage_options'))) { 177 $updateFailed = true; 178 } 179 180 // Does the nonce check pass? 181 182 if (isset($_POST['nonce']) && sanitize_html_class($_POST['action']) === 'stylebidet_update_settings' && wp_verify_nonce(sanitize_html_class($_POST['nonce']), 'stylebidet_update_settings')) { 183 $shouldUpdate = true; 184 } else { 185 $updateFailed = true; 186 } 187 } 167 188 168 189 foreach ($optionsArray as $option=>$value) { … … 170 191 // Save, if required 171 192 172 if ( isset($_REQUEST['updateVNMStyleBidetSettings'])) {193 if ($shouldUpdate) { 173 194 if (array_key_exists($option, $_POST)) { 174 if ( $_POST[$option]) {175 176 update_option('vnmStyleBidet_' . $option, 1); // We can assume it's 'on'195 if (isset($_POST[$option]) && sanitize_html_class($_POST[$option]) === 'on') { 196 197 update_option('vnmStyleBidet_' . $option, 1); // It's checked, so we switch the option on 177 198 178 199 } else { 179 200 180 update_option('vnmStyleBidet_' . $option, 0); // We can assume it's unchecked201 update_option('vnmStyleBidet_' . $option, 0); // It's unchecked, so switch the option off 181 202 182 203 } … … 258 279 <?php endif; ?> 259 280 281 <?php if ($updateFailed) : ?> 282 <section class="wrapper updated"> 283 <div class="padded-section"> 284 <span class="dashicons dashicons-warning notice-icon secondarycolor"></span> 285 <?php _e('Uh oh, it looks like you can\'t do that.', 'styebidet'); ?> 286 </div> 287 </section> 288 <?php endif; ?> 289 260 290 <?php 261 291 /// … … 277 307 <div class="padded-section"> 278 308 <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=vnmStyleBidetSettings" class="form" method="post"> 279 309 310 <input type="hidden" name="action" value="stylebidet_update_settings" /> 311 <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('stylebidet_update_settings'); ?>" /> 312 <?php wp_nonce_field('vnm_stylebidet_nonce_action','stylebidet_admin_nonce' ); ?> 313 280 314 <table class="form-table"> 281 315 … … 434 468 <div class="vnm-rating-request box"> 435 469 <?php 436 /*printf(470 printf( 437 471 __('Is StyleBidet making your life a little easier? %sWhy not leave us a %s review?%s %s', 'stylebidet'), 438 '<a href=" thing" target="_blank">',472 '<a href="https://wordpress.org/plugins/stylebidet/" target="_blank">', 439 473 '<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>', 440 474 '</a>', 441 475 '<span class="dashicons dashicons-smiley"></span>' 442 ); */476 ); 443 477 ?> 444 478 </div> … … 479 513 // Include htmLawed (this is pretty much only used for <font> & inline style tags 480 514 481 include_once('includes/htmlLawed.php'); 515 if (!function_exists('htmLawed')) { 516 include_once('includes/htmlLawed.php'); 517 } 482 518 483 519 // Adding a 'nonsense' value so that at lest there's something in the array
Note: See TracChangeset
for help on using the changeset viewer.