Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wpmetabox/meta-box
Browse files Browse the repository at this point in the history
  • Loading branch information
rilwis committed Jan 10, 2025
2 parents 37f6b32 + c3147d9 commit 6abb70e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/validation/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

if ( parts[ 1 ] && isNaN( parts[ 1 ] ) ) {
// Remove []
let words = name.match( /(\w+)|(\[\w+\])/g );
let words = name.match( /([\w-]+)|(\[\w+\])/g );
let resultArray = [ words.join( "" ) ];

// Remove characters "[" and "]".
Expand Down Expand Up @@ -179,6 +179,10 @@
if ( !$el.length ) {
$el = $( '[name*="[' + k + ']"]' ); // Subfields in groups.
}
if ( !$el.length ) {
$el = $( '[name*="' + k + '"]' ); // contains field ID.
}

if ( $el.length ) {
$el.closest( '.rwmb-input' ).siblings( '.rwmb-label' ).find( 'label' ).append( '<span class="rwmb-required">*</span>' );
}
Expand Down

0 comments on commit 6abb70e

Please sign in to comment.