@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?post_type=lh-portfolio-doc&#038;p=150027>
  a sioc:Post ;
  dc:title "Hooks, filters and cron" ;
  dcterms:identifier 150027 ;
  dc:modified "2026-10-12T03:44:39Z"^^xsd:dateTime ;
  dc:created "2026-10-12T02:58:29Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-addresses/hooks-filters-and-cron/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-addresses/">LH Addresses</a></li></ul>
<h2 class="wp-block-heading">Filters answered by other plugins</h2>



<ul class="wp-block-list">
<li><code>lh_addresses_site_can_read( false, $viewer_id, $user_id, $blog_id )</code>: whether the viewer may read the addresses the user has given to that site. Answered by LH Membership.</li>



<li><code>lh_places_geocode( null, $fields )</code>: returns <code>array( 'lat', 'lng', 'accuracy' )</code> or null for a structured address. Answered by LH Places.</li>
</ul>



<h2 class="wp-block-heading">Configuration filters</h2>



<ul class="wp-block-list">
<li><code>lh_addresses_return_address_types</code> (default residential, postal, delivery, billing, work)</li>



<li><code>lh_addresses_return_admin_capability</code> (default install_plugins)</li>



<li><code>lh_addresses_return_default_country_code</code> (default: the site locale&#8217;s region)</li>



<li><code>lh_addresses_geocode_batch_size</code> (25), <code>lh_addresses_geocode_max_attempts</code> (5), <code>lh_addresses_geocode_interval_microseconds</code> (1,100,000), <code>lh_addresses_geocode_time_budget</code> (45 seconds)</li>



<li><code>lh_addresses_init_plugin</code>, <code>lh_addresses_return_plugin_debugging_status</code></li>
</ul>



<h2 class="wp-block-heading">Actions fired</h2>



<ul class="wp-block-list">
<li><code>lh_addresses_saved( $id, $user_id, $changed, $existing )</code></li>



<li><code>lh_addresses_use_added( $address_id, $user_id, $blog_id, $type )</code>, <code>lh_addresses_use_removed( $address_id, $blog_id, $type )</code></li>



<li><code>lh_addresses_site_uses_removed( $user_id, $blog_id, $removed )</code></li>



<li><code>lh_addresses_user_addresses_deleted( $user_id, $ids )</code></li>



<li><code>lh_addresses_geocoded( $id, $lat, $lng )</code></li>
</ul>



<h2 class="wp-block-heading">Core hooks used</h2>



<p class="wp-block-paragraph"><code>remove_user_from_blog</code> removes that site&#8217;s uses; <code>wpmu_delete_user</code> (or <code>delete_user</code> on single site) deletes all of the user&#8217;s addresses; <code>wp_privacy_personal_data_exporters</code> and <code>wp_privacy_personal_data_erasers</code> register the Addresses exporter and eraser (network-wide on the main site, site-scoped elsewhere).</p>



<h2 class="wp-block-heading">Cron</h2>



<p class="wp-block-paragraph"><code>lh_addresses_geocode_queue</code>, 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 <code>lh_places_geocode</code>.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Addresses
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 ): returns array( '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&#8217;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&#8217;s uses; wpmu_delete_user (or delete_user on single site) deletes all of the user&#8217;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.
""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
