Code Duplication    Length = 6-6 lines in 2 locations

includes/user-functions.php 1 location

@@ 499-504 (lines=6) @@
496
	$by_user_id = get_user_by( 'id', $donor_id ) ? true : false;
497
498
	// Backward compatibility.
499
	if ( ! give_has_upgrade_completed( 'v20_upgrades_user_address' ) && $by_user_id ) {
500
		return wp_parse_args(
501
			(array) get_user_meta( $donor_id, '_give_user_address', true ),
502
			$default_address
503
		);
504
	}
505
506
	$donor = new Give_Donor( $donor_id, $by_user_id );
507

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;