Only allow max_height to return empty value

This commit is contained in:
Robin Cornett
2016-08-16 16:33:12 -04:00
parent e47b12bc47
commit b1efda929a
2 changed files with 4 additions and 4 deletions
@@ -493,6 +493,9 @@ class Display_Featured_Image_Genesis_Settings extends Display_Featured_Image_Gen
if ( 'do_checkbox' === $field['callback'] ) {
$new_value[ $field['id'] ] = $this->one_zero( $new_value[ $field['id'] ] );
} elseif ( 'do_number' === $field['callback'] ) {
if ( 'max_height' === $field['id'] && empty( $new_value[ $field['id'] ] ) ) {
continue;
}
$new_value[ $field['id'] ] = $this->check_value( $new_value[ $field['id'] ], $this->setting[ $field['id'] ], $field['args']['min'], $field['args']['max'] );
} elseif ( 'do_radio_buttons' === $field['callback'] ) {
$new_value[ $field['id'] ] = absint( $new_value[ $field['id'] ] );
@@ -555,9 +558,6 @@ class Display_Featured_Image_Genesis_Settings extends Display_Featured_Image_Gen
* @return int
*/
protected function check_value( $new_value, $old_value, $min, $max ) {
if ( empty( $new_value ) ) {
return '';
}
if ( $new_value >= $min && $new_value <= $max ) {
return (int) $new_value;
}
+1 -1
View File
@@ -1,4 +1,4 @@
;( function ( document, $, undefined ) {
( function ( document, $, undefined ) {
'use strict';
var plugin = {};