Skip to content
Docs
Get RestroPress

Action

rpress_account_hub_address_saved

Updated
On this page

Fires after a customer address is added or updated in the account hub.

Runs at the end of rpress_account_hub_save_address(), after the address list is stored and the default address has been set when needed. It fires for saves from the account page request handler and for addresses copied from an order when the checkout save-address option was ticked.

Parameters#

ParameterTypeDescription
$user_idintUser ID.
$indexintIndex of the saved address in the user's address list.
$addressarrayThe sanitised address that was stored.

Example#

add_action( 'rpress_account_hub_address_saved', 'my_address_saved', 10, 3 );
function my_address_saved( $user_id, $index, $address ) {
	update_user_meta( $user_id, '_my_last_saved_city', $address['city'] );
}

Source#

Fired from:

  • includes/features/account-hub/addresses.php (line 214), in rpress_account_hub_save_address()

See also#

Was this page helpful?