Skip to content

Commit

Permalink
Allow Text fields to show 0
Browse files Browse the repository at this point in the history
PHP falsiness strikes again. If a 0 were the value for a Text input, it
would show the default instead.
  • Loading branch information
d4mation committed Aug 3, 2021
1 parent 6102e05 commit 4ea7a5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/fields/views/fields/field-text.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<input type="text"
name="<?php echo esc_attr( $name ); ?>"
id="<?php esc_attr( $args['id'] ); ?>"
value="<?php echo $value ? esc_attr( $value ) : esc_attr( $args['default'] ); ?>"
value="<?php echo ( $value !== false && $value !== '' ) ? esc_attr( $value ) : esc_attr( $args['default'] ); ?>"
class="<?php echo isset( $args['input_class'] ) ? esc_attr( $args['input_class'] ) : 'regular-text'; ?>"
<?php RBM_FH_Field::input_atts( $args ); ?>
/>

0 comments on commit 4ea7a5e

Please sign in to comment.