Skip to content

Commit

Permalink
Ensure 'id' exists in before trying to modify it
Browse files Browse the repository at this point in the history
  • Loading branch information
enejb committed Jan 16, 2025
1 parent e1e5eb1 commit f83b7fb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function __construct( $attributes, $content = null ) {
}

if ( ! empty( self::$forms ) ) {
// Ensure 'id' exists in $attributes before trying to modify it
if ( ! isset( $attributes['id'] ) ) {
$attributes['id'] = '';
}
$attributes['id'] = $attributes['id'] . '-' . ( count( self::$forms ) + 1 );
}

Expand Down

0 comments on commit f83b7fb

Please sign in to comment.