Skip to content

Commit 3097d5f

Browse files
committed
New url_slug validation. Merged a pull from @Ninos for validation of 0. Fixed background field bug, as well as a section visual improvement. Also added some margin above errors/warnings.
1 parent cae6cc3 commit 3097d5f

File tree

9 files changed

+94
-10
lines changed

9 files changed

+94
-10
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Redux Framework Changelog
22

3+
## 3.4.3.6
4+
* Fixed #2047 - Validation will now accept 0 as a value to be tested. Thanks @Ninos!
5+
* Added url_slug validation with option flush_permalinks!
6+
* Fixed Issue where the remove of background field was always showing an empty preview box.
7+
* Modified Turned ajax_save on by default for additional bug reports. ;)
8+
* Modified Added some margin above validation errors/warnings so they look better.
9+
* Modified Removed previous element border for any section so it looks better.
10+
311
## 3.4.3.5
412
* Fixed #2081 - Section field hiding any field after. Weird.
513

ReduxCore/assets/css/redux-admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ReduxCore/assets/css/redux-admin.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,17 +357,20 @@
357357
color: #C09853;
358358
font-weight: normal;
359359
display: block;
360+
margin-top: 10px;
360361
}
361362

362363
.redux-field-warning {
363364
border-color: #C09853;
365+
margin-top: 10px;
364366
}
365367

366368
.redux-th-error {
367369
font-size: 1em;
368370
color: #B94A48;
369371
font-weight: normal;
370372
display: block;
373+
margin-top: 10px;
371374
}
372375
}
373376

ReduxCore/framework.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ReduxFramework {
7070
// ATTENTION DEVS
7171
// Please update the build number with each push, no matter how small.
7272
// This will make for easier support when we ask users what version they are using.
73-
public static $_version = '3.4.3.4';
73+
public static $_version = '3.4.3.6';
7474
public static $_dir;
7575
public static $_url;
7676
public static $_upload_dir;
@@ -392,6 +392,7 @@ public function __construct( $sections = array(), $args = array(), $extra_tabs =
392392
}
393393
// Ajax saving!!!
394394
add_action( "wp_ajax_" . $this->args['opt_name'] . '_ajax_save', array( $this, "ajax_save" ) );
395+
395396
}
396397

397398
/**
@@ -518,7 +519,7 @@ private function set_default_args() {
518519
'disable_tracking' => false,
519520
'templates_path' => '',
520521
// Path to the templates file for various Redux elements
521-
'ajax_save' => false,
522+
'ajax_save' => true,
522523
// Disable the use of ajax saving for the panel
523524
);
524525
}
@@ -2800,20 +2801,20 @@ public function _validate_values( $plugin_options, $options, $sections ) {
28002801
if ( isset ( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty ( $plugin_options[ $field['id'] ] ) ) {
28012802
foreach ( $plugin_options[ $field['id'] ] as $key => $value ) {
28022803
$before = $after = null;
2803-
if ( isset ( $plugin_options[ $field['id'] ][ $key ] ) && ! empty ( $plugin_options[ $field['id'] ][ $key ] ) ) {
2804+
if ( isset ( $plugin_options[ $field['id'] ][ $key ] ) && ( !empty ( $plugin_options[ $field[ 'id' ] ][ $key ] ) || $plugin_options[ $field[ 'id' ] ][ $key ] == '0' ) ) {
28042805
if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) {
28052806
$before = $plugin_options[ $field['id'] ][ $key ];
28062807
} else {
28072808
$before = trim( $plugin_options[ $field['id'] ][ $key ] );
28082809
}
28092810
}
28102811

2811-
if ( isset ( $options[ $field['id'] ][ $key ] ) && ! empty ( $options[ $field['id'] ][ $key ] ) ) {
2812+
if ( isset ( $options[ $field['id'] ][ $key ] ) && ( !empty ( $plugin_options[ $field[ 'id' ] ][ $key ] ) || $plugin_options[ $field[ 'id' ] ][ $key ] == '0' ) ) {
28122813
$after = $options[ $field['id'] ][ $key ];
28132814
}
28142815

28152816
$validation = new $validate ( $this, $field, $before, $after );
2816-
if ( ! empty ( $validation->value ) ) {
2817+
if ( ! empty ( $validation->value ) || $validation->value == '0' ) {
28172818
$plugin_options[ $field['id'] ][ $key ] = $validation->value;
28182819
} else {
28192820
unset ( $plugin_options[ $field['id'] ][ $key ] );

ReduxCore/inc/fields/background/field_background.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
'click', function( e ) {
4141
e.preventDefault();
4242
redux.field_objects.background.removeImage( $( this ).parents( '.redux-container-background:first' ) );
43-
redux.field_objects.background.preview( $( this ) );
4443
return false;
4544
}
4645
);

ReduxCore/inc/fields/background/field_background.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ReduxCore/inc/fields/section/field_section.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function render() {
9494
<script type="text/javascript">
9595
jQuery( document ).ready(
9696
function() {
97-
jQuery( '#<?php echo $this->field['id']; ?>-marker' ).parents( 'tr:first' ).css( {display: 'none'} );
97+
jQuery( '#<?php echo $this->field['id']; ?>-marker' ).parents( 'tr:first' ).css( {display: 'none'} ).prev('tr' ).css('border-bottom','none');;
9898
var group = jQuery( '#<?php echo $this->field['id']; ?>-marker' ).parents( '.redux-group-tab:first' );
9999
if ( !group.hasClass( 'sectionsChecked' ) ) {
100100
group.addClass( 'sectionsChecked' );

0 commit comments

Comments
 (0)