Skip to content
Docs
Get RestroPress

Filter

rpress_payment_address

Updated
On this page

Filters the billing address array returned for a payment.

Runs when the billing address array for the order, with the keys line1, line2, city, state, zip and country property is read from an RPRESS_Payment object (for example $payment->address), through the object's magic getter. Reads made inside the class itself go straight to the property and are not filtered.

Parameters#

ParameterTypeDescription
$addressarrayThe value loaded for the payment.
$payment_idintThe payment (order) ID.
$paymentRPRESS_PaymentThe payment object being read.

Return value#

array. The (possibly modified) value returned for the property.

Example#

add_filter( 'rpress_payment_address', 'my_default_payment_country', 10, 3 );
function my_default_payment_country( $address, $payment_id, $payment ) {
	if ( empty( $address['country'] ) ) {
		$address['country'] = 'US';
	}
	return $address;
}

Source#

Applied in:

  • includes/payments/class-rpress-payment.php (line 2283), in RPRESS_Payment::get_address()
Was this page helpful?