Code Duplication    Length = 9-9 lines in 3 locations

extensions/blocks/mailchimp/mailchimp.php 1 location

@@ 243-251 (lines=9) @@
240
		);
241
	}
242
243
	if ( ! empty( $attr['customTextButtonColor'] ) ) {
244
		array_push(
245
			$button_styles,
246
			sprintf(
247
				'color: %s',
248
				sanitize_hex_color( $attr['customTextButtonColor'] )
249
			)
250
		);
251
	}
252
253
	$button_styles  = implode( ';', $button_styles );
254
	$button_classes = 'components-button is-button is-primary ';

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

@@ 273-281 (lines=9) @@
270
			: __( 'Your contribution', 'jetpack' );
271
272
		$button_styles = array();
273
		if ( ! empty( $attrs['customBackgroundButtonColor'] ) ) {
274
			array_push(
275
				$button_styles,
276
				sprintf(
277
					'background-color: %s',
278
					sanitize_hex_color( $attrs['customBackgroundButtonColor'] )
279
				)
280
			);
281
		}
282
		if ( ! empty( $attrs['customTextButtonColor'] ) ) {
283
			array_push(
284
				$button_styles,
@@ 282-290 (lines=9) @@
279
				)
280
			);
281
		}
282
		if ( ! empty( $attrs['customTextButtonColor'] ) ) {
283
			array_push(
284
				$button_styles,
285
				sprintf(
286
					'color: %s',
287
					sanitize_hex_color( $attrs['customTextButtonColor'] )
288
				)
289
			);
290
		}
291
		$button_styles = implode( ';', $button_styles );
292
293
		return sprintf(