Code Duplication    Length = 8-10 lines in 2 locations

includes/class-give-html-elements.php 1 location

@@ 197-204 (lines=8) @@
194
195
		$options = array();
196
197
		if ( $donors ) {
198
			$options[0] = esc_html__( 'No donor attached', 'give' );
199
			foreach ( $donors as $donor ) {
200
				$options[ absint( $donor->id ) ] = esc_html( $donor->name . ' (' . $donor->email . ')' );
201
			}
202
		} else {
203
			$options[0] = esc_html__( 'No donors found.', 'give' );
204
		}
205
206
		if ( ! empty( $args['selected'] ) ) {
207

includes/emails/template.php 1 location

@@ 364-373 (lines=10) @@
361
	$options  = array();
362
363
	//Provide nice human readable options.
364
	if ( $payments ) {
365
		$options[0] = esc_html__( '- Select a donation -', 'give' );
366
		foreach ( $payments as $payment ) {
367
368
			$options[ $payment->ID ] = esc_html( '#' . $payment->ID . ' - ' . $payment->email . ' - ' . $payment->form_title );
369
370
		}
371
	} else {
372
		$options[0] = esc_html__( 'No donations found.', 'give' );
373
	}
374
375
	//Start constructing HTML output.
376
	$transaction_header = '<div style="margin:0;padding:10px 0;width:100%;background-color:#FFF;border-bottom:1px solid #eee; text-align:center;">';