Back to list of all filter and action hooks for Address Book for WooCommerce.
Description #
Define fields to skip when checking if an address entry is considered empty or incomplete.
This filter is primarily used during the address book migration process (when the plugin is first installed) to determine which fields should be ignored when evaluating whether an address has meaningful data worth migrating from WooCommerce’s default address storage to the address book system.
Default Skip Fields:
- Empty Check Context:
default_shipping,default_billing,address_id,first_name,last_name,email - Migration Context:
first_name,last_name,company,address_1,address_2,city,postcode,country,state,email,phone
Parameters #
$skip_field_keys(array) Array of field keys to skip when determining if address is empty.
Examples #
/**
* Skip company and phone fields when checking if address is empty
* This changes the default behavior: addresses with only company/phone data
* will now be considered "empty" and won't be migrated to address book
*/
function skip_company_phone_in_empty_check( $skip_field_keys ) {
// Add company and phone to skip list for empty check
// This means addresses with ONLY company/phone data will be considered empty
$skip_field_keys[] = 'company';
$skip_field_keys[] = 'phone';
return $skip_field_keys;
}
add_filter( 'fc_pro_address_book_entry_is_empty_field_keys_skip_list', 'skip_company_phone_in_empty_check', 10 );
