Code Duplication    Length = 6-6 lines in 2 locations

includes/class-give-donor.php 1 location

@@ 300-305 (lines=6) @@
297
		);
298
299
		// Backward compatibility.
300
		if ( ! give_has_upgrade_completed( 'v20_upgrades_user_address' ) ) {
301
302
			// Backward compatibility for user id param.
303
			return wp_parse_args( (array) get_user_meta( $this->user_id, '_give_user_address', true ), $default_address );
304
305
		}
306
307
		if ( ! $this->id || empty( $this->address ) || ! array_key_exists( $args['address_type'], $this->address ) ) {
308
			return $default_address;

includes/user-functions.php 1 location

@@ 502-507 (lines=6) @@
499
	}
500
501
	// Backward compatibility.
502
	if ( ! give_has_upgrade_completed( 'v20_upgrades_user_address' ) && $by_user_id ) {
503
		return wp_parse_args(
504
			(array) get_user_meta( $donor_id, '_give_user_address', true ),
505
			$default_address
506
		);
507
	}
508
509
	$donor = new Give_Donor( $donor_id, (bool) $args['by_user_id'] );
510