Skip to content

Commit

Permalink
fix: validation with conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tanftw committed Sep 26, 2024
1 parent 0caaf15 commit badf6be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public static function show( array $field, bool $saved, $post_id = 0 ) {

// Display label and input in DIV and allow user-defined classes to be appended.
$classes = "rwmb-field rwmb-{$field['type']}-wrapper " . $field['class'];
if ( ! empty( $field['required'] ) ) {
$required = $field['required'] || ! empty( $field['attributes']['required'] );

if ( $required ) {
$classes .= ' required';
}

Expand Down

0 comments on commit badf6be

Please sign in to comment.