Code Duplication    Length = 3-5 lines in 2 locations

includes/wpinv-template-functions.php 1 location

@@ 391-393 (lines=3) @@
388
    }
389
    
390
    $options = '';
391
    if( !empty( $args['onchange'] ) ) {
392
        $options .= ' onchange="' . esc_attr( $args['onchange'] ) . '"';
393
    }
394
    
395
    if( !empty( $args['required'] ) ) {
396
        $options .= ' required="required"';

includes/admin/register-settings.php 1 location

@@ 1308-1312 (lines=5) @@
1305
		$placeholder = '';
1306
	}
1307
    
1308
    if( !empty( $args['onchange'] ) ) {
1309
        $onchange = ' onchange="' . esc_attr( $args['onchange'] ) . '"';
1310
    } else {
1311
        $onchange = '';
1312
    }
1313
1314
    $class = !empty( $args['class'] ) ? ' ' . esc_attr( $args['class'] ) : '';
1315