Code Duplication    Length = 5-6 lines in 3 locations

includes/admin/give-metabox-functions.php 2 locations

@@ 304-309 (lines=6) @@
301
	// Custom attribute handling
302
	$custom_attributes = array();
303
304
	if ( ! empty( $field['attributes'] ) && is_array( $field['attributes'] ) ) {
305
306
		foreach ( $field['attributes'] as $attribute => $value ) {
307
			$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
308
		}
309
	}
310
	?>
311
312
	<input
@@ 811-816 (lines=6) @@
808
	// Custom attribute handling
809
	$custom_attributes = array();
810
811
	if ( ! empty( $field['attributes'] ) && is_array( $field['attributes'] ) ) {
812
813
		foreach ( $field['attributes'] as $attribute => $value ) {
814
			$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
815
		}
816
	}
817
818
	return implode( ' ', $custom_attributes );
819
}

includes/admin/class-admin-settings.php 1 location

@@ 334-338 (lines=5) @@
331
				// Custom attribute handling.
332
				$custom_attributes = array();
333
334
				if ( ! empty( $value['attributes'] ) && is_array( $value['attributes'] ) ) {
335
					foreach ( $value['attributes'] as $attribute => $attribute_value ) {
336
						$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
337
					}
338
				}
339
340
				// Description handling.
341
				$description          = self::get_field_description( $value );