Code Duplication    Length = 5-5 lines in 2 locations

classes/admin.php 2 locations

@@ 1226-1230 (lines=5) @@
1223
1224
			if ( in_array( 'fields', $include, true ) || empty( $include ) ) {
1225
				$type = isset( $data['field_type'] ) ? esc_attr( $data['field_type'] ) : ''; // can come from ajax
1226
				foreach ( $object['data']['fields'] as $key => $value ) {
1227
					if ( '' === $type || $type === $value['type'] ) {
1228
						$object_fields[ $key ] = $value;
1229
					}
1230
				}
1231
				$object_description['fields'] = $object_fields;
1232
			}
1233
@@ 1266-1270 (lines=5) @@
1263
			$object_fields        = array();
1264
			$type                 = isset( $data['type'] ) ? esc_attr( $data['type'] ) : '';
1265
			$include_record_types = isset( $data['include_record_types'] ) ? esc_attr( $data['include_record_types'] ) : false;
1266
			foreach ( $object['data']['fields'] as $key => $value ) {
1267
				if ( '' === $type || $type === $value['type'] ) {
1268
					$object_fields[ $key ] = $value;
1269
				}
1270
			}
1271
			if ( true === $include_record_types ) {
1272
				$object_record_types = array();
1273
				if ( isset( $object['data']['recordTypeInfos'] ) && count( $object['data']['recordTypeInfos'] ) > 1 ) {