Skip to content
Docs
Get RestroPress

Filter

rpress_checkout_billing_details_address

Updated
On this page

Filters the billing address values used to pre-populate the checkout billing fields.

Runs in rpress_default_cc_address_fields() after the address is read from the checkout session and, for logged-in customers, from the stored user address. The address array uses the keys line1, line2, city, zip, state and country.

Available since RestroPress 1.0.0.

Parameters#

ParameterTypeDescription
$addressarrayCustomer billing address with the keys line1, line2, city, zip, state and country.
$customerarrayCustomer data from the session.

Return value#

array. The address used to pre-populate the billing fields.

Example#

function my_billing_details_address( $address, $customer ) {
	if ( empty( $address['country'] ) ) {
		$address['country'] = 'US';
	}
	return $address;
}
add_filter( 'rpress_checkout_billing_details_address', 'my_billing_details_address', 10, 2 );

Source#

Applied in:

  • includes/checkout/template.php (line 545), in rpress_default_cc_address_fields()

See also#

Was this page helpful?