Code Duplication    Length = 9-9 lines in 3 locations

modules/memberships/class-jetpack-memberships.php 2 locations

@@ 245-253 (lines=9) @@
242
			$data['button_label'] = $attrs['submitButtonText'];
243
		}
244
		$button_styles = array();
245
		if ( ! empty( $attrs['customBackgroundButtonColor'] ) ) {
246
			array_push(
247
				$button_styles,
248
				sprintf(
249
					'background-color: %s',
250
					sanitize_hex_color( $attrs['customBackgroundButtonColor'] )
251
				)
252
			);
253
		}
254
		if ( ! empty( $attrs['customTextButtonColor'] ) ) {
255
			array_push(
256
				$button_styles,
@@ 254-262 (lines=9) @@
251
				)
252
			);
253
		}
254
		if ( ! empty( $attrs['customTextButtonColor'] ) ) {
255
			array_push(
256
				$button_styles,
257
				sprintf(
258
					'color: %s',
259
					sanitize_hex_color( $attrs['customTextButtonColor'] )
260
				)
261
			);
262
		}
263
		$button_styles = implode( ';', $button_styles );
264
		add_thickbox();
265
		return sprintf(

extensions/blocks/mailchimp/mailchimp.php 1 location

@@ 54-62 (lines=9) @@
51
	$classes = Jetpack_Gutenberg::block_classes( 'mailchimp', $attr );
52
53
	$button_styles = array();
54
	if ( ! empty( $attr['customBackgroundButtonColor'] ) ) {
55
		array_push(
56
			$button_styles,
57
			sprintf(
58
				'background-color: %s',
59
				sanitize_hex_color( $attr['customBackgroundButtonColor'] )
60
			)
61
		);
62
	}
63
	if ( ! empty( $attr['customTextButtonColor'] ) ) {
64
		array_push(
65
			$button_styles,