Filter
rpress_payment_address
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#
| Parameter | Type | Description |
|---|---|---|
$address | array | The value loaded for the payment. |
$payment_id | int | The payment (order) ID. |
$payment | RPRESS_Payment | The 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), inRPRESS_Payment::get_address()
Was this page helpful?
