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

@@ 1214-1218 (lines=5) @@
1211
		$placeholder = '';
1212
	}
1213
    
1214
    if( !empty( $args['onchange'] ) ) {
1215
        $onchange = ' onchange="' . esc_attr( $args['onchange'] ) . '"';
1216
    } else {
1217
        $onchange = '';
1218
    }
1219
1220
	$html = '<select id="wpinv_settings[' . $sanitize_id . ']" name="wpinv_settings[' . esc_attr( $args['id'] ) . ']" data-placeholder="' . esc_html( $placeholder ) . '"' . $onchange . ' />';
1221