@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=147302>
  a sioc:Post ;
  dc:title "Hooks & Filters" ;
  dcterms:identifier 147302 ;
  dc:modified "2026-09-13T14:11:17Z"^^xsd:dateTime ;
  dc:created "2026-09-13T14:10:02Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-user-provisioning/hooks-filters/> ;
  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>Type:</strong> Doc-section</li><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-user-provisioning/">LH User Provisioning</a></li></ul>
<h2 class="wp-block-heading">Actions</h2>



<p class="wp-block-paragraph"><strong><code>lh_user_provisioning_user_provisioned</code></strong> — fires after <code>ensure_user()</code> completes.</p>



<pre class="wp-block-code"><code>do_action( 'lh_user_provisioning_user_provisioned', WP_User $user, bool $is_new, array $args );</code></pre>



<p class="wp-block-paragraph">This plugin also listens to two WordPress core hooks network-wide, both at priority 20 so it runs after other plugins&#8217; own handlers as the final word on convention — not exposed as its own hooks, documented here for completeness:</p>



<ul class="wp-block-list">
<li><code>user_register</code> — calls the guarded <code>ensure_login_matches_email()</code> / <code>ensure_nicename_matches_id()</code> pair on every new user created anywhere on the network, not just via this plugin&#8217;s own API</li>
<li><code>profile_update</code> — same pair, e.g. when someone&#8217;s email changes via a profile edit form elsewhere on the network</li>
</ul>



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



<p class="wp-block-paragraph"><strong><code>lh_user_provisioning_pre_create_userdata</code></strong> — filters the <code>$userdata</code> array immediately before <code>wp_insert_user()</code> is called.</p>



<pre class="wp-block-code"><code>apply_filters( 'lh_user_provisioning_pre_create_userdata', array $userdata, string $email, array $args );</code></pre>



<p class="wp-block-paragraph"><strong><code>lh_user_identity_get_user_by_email_fallback</code></strong> (consumed, not defined here) — used internally by <code>resolve_existing_user_by_email()</code> to resolve alias emails when <code>lh-user-identity</code> is active. Documented no-op otherwise, so it is always safe to call unconditionally.</p>



<pre class="wp-block-code"><code>apply_filters( 'lh_user_identity_get_user_by_email_fallback', false, string $email );</code></pre>



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



<p class="wp-block-paragraph"><strong><code>lh_user_provisioning_integrity_check</code></strong> — runs hourly. Scans for users where <code>user_login != user_email</code> or <code>user_nicename != CAST(ID AS CHAR)</code>, fixing up to 50 per run. With the <code>user_register</code>/<code>profile_update</code> hooks providing real-time coverage everywhere, this is a backstop for accounts predating those hooks (or that slip through some other way) rather than the primary enforcement mechanism.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Type: Doc-sectionPart of: LH User Provisioning
Actions



lh_user_provisioning_user_provisioned — fires after ensure_user() completes.



do_action( 'lh_user_provisioning_user_provisioned', WP_User $user, bool $is_new, array $args );



This plugin also listens to two WordPress core hooks network-wide, both at priority 20 so it runs after other plugins&#8217; own handlers as the final word on convention — not exposed as its own hooks, documented here for completeness:




user_register — calls the guarded ensure_login_matches_email() / ensure_nicename_matches_id() pair on every new user created anywhere on the network, not just via this plugin&#8217;s own API
profile_update — same pair, e.g. when someone&#8217;s email changes via a profile edit form elsewhere on the network




Filters



lh_user_provisioning_pre_create_userdata — filters the $userdata array immediately before wp_insert_user() is called.



apply_filters( 'lh_user_provisioning_pre_create_userdata', array $userdata, string $email, array $args );



lh_user_identity_get_user_by_email_fallback (consumed, not defined here) — used internally by resolve_existing_user_by_email() to resolve alias emails when lh-user-identity is active. Documented no-op otherwise, so it is always safe to call unconditionally.



apply_filters( 'lh_user_identity_get_user_by_email_fallback', false, string $email );



Cron



lh_user_provisioning_integrity_check — runs hourly. Scans for users where user_login != user_email or user_nicename != CAST(ID AS CHAR), fixing up to 50 per run. With the user_register/profile_update hooks providing real-time coverage everywhere, this is a backstop for accounts predating those hooks (or that slip through some other way) rather than the primary enforcement mechanism.
""" ;
  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> .
