Code Duplication    Length = 5-5 lines in 2 locations

src/Form/FieldBuilder.php 1 location

@@ 113-117 (lines=5) @@
110
    protected function get_hidden( $field ) {
111
        $visible = false;
112
        // if both hide label and hide field are checked, we gotta hide the field!
113
        if( isset( $field['hide' ] ) && $field['hide'] == 1 ) {
114
            if( isset( $field['hide-label' ] ) && $field['hide-label'] == 1 ) {
115
                $visible = true;
116
            }
117
        }
118
        return $visible;
119
    }
120

public/partials/shortcodes/process_form_shortcode.php 1 location

@@ 568-572 (lines=5) @@
565
					}
566
567
					// if both hide label and hide field are checked, we gotta hide the field!
568
					if( isset( $field['hide' ] ) && $field['hide'] == 1 ) {
569
						if( isset( $field['hide-label' ] ) && $field['hide-label'] == 1 ) {
570
							$field_array['visible'] = 'style="display:none;"';
571
						}
572
					}
573
574
					// Sanitize the classes
575
					$label_class_array = function_exists( 'sanitize_html_class' ) ? array_map( 'sanitize_html_class', $label_class_array ) : $label_class_array;