Filters answered by other plugins
lh_addresses_site_can_read( false, $viewer_id, $user_id, $blog_id ): whether the viewer may read the addresses the user has given to that site. Answered by LH Membership.lh_places_geocode( null, $fields ): returnsarray( 'lat', 'lng', 'accuracy' )or null for a structured address. Answered by LH Places.
Configuration filters
lh_addresses_return_address_types(default residential, postal, delivery, billing, work)lh_addresses_return_admin_capability(default install_plugins)lh_addresses_return_default_country_code(default: the site locale’s region)lh_addresses_geocode_batch_size(25),lh_addresses_geocode_max_attempts(5),lh_addresses_geocode_interval_microseconds(1,100,000),lh_addresses_geocode_time_budget(45 seconds)lh_addresses_init_plugin,lh_addresses_return_plugin_debugging_status
Actions fired
lh_addresses_saved( $id, $user_id, $changed, $existing )lh_addresses_use_added( $address_id, $user_id, $blog_id, $type ),lh_addresses_use_removed( $address_id, $blog_id, $type )lh_addresses_site_uses_removed( $user_id, $blog_id, $removed )lh_addresses_user_addresses_deleted( $user_id, $ids )lh_addresses_geocoded( $id, $lat, $lng )
Core hooks used
remove_user_from_blog removes that site’s uses; wpmu_delete_user (or delete_user on single site) deletes all of the user’s addresses; wp_privacy_personal_data_exporters and wp_privacy_personal_data_erasers register the Addresses exporter and eraser (network-wide on the main site, site-scoped elsewhere).
Cron
lh_addresses_geocode_queue, every five minutes on the main site. Takes pending addresses, then failed ones whose backoff (2 to the power of attempts, in hours) has passed, and geocodes up to the batch size at no more than one request per second, under a two-minute network lock. After five failed attempts an address is marked skipped. Does nothing when no geocoder answers lh_places_geocode.
