Skip to content
Docs
Get RestroPress

Filter

rpress_account_hub_max_addresses

Updated
On this page

Filters the maximum number of saved addresses per customer.

Checked by rpress_account_hub_save_address() when a new address would be added to a customer's address book. At or above the limit, saving fails with an rpress_address_limit error. Updating an existing address is not blocked.

Parameters#

ParameterTypeDescription
$maxintMaximum number of addresses. Default 20.

Return value#

int. Maximum number of addresses.

Example#

add_filter( 'rpress_account_hub_max_addresses', 'my_max_addresses', 10, 1 );
function my_max_addresses( $max ) {
	return 5;
}

Source#

Applied in:

  • includes/features/account-hub/addresses.php (line 31), in rpress_account_hub_max_addresses()

See also#

Was this page helpful?