Skip to content

Auth Actions

5 unique action hooks currently map to this category, across 5 call sites.

Hook Inventory

HookEditionCall SitesFirst Source
fluent_community/auth/before_auth_page_processCore1fluent-community/Modules/Auth/AuthModdule.php:128
fluent_community/auth/show_invitation_for_userCore1fluent-community/Modules/Auth/AuthModdule.php:270
fluent_community/invitation_createdCore1fluent-community/Modules/Auth/Classes/InvitationService.php:193
fluent_community/invitation_link_createdCore1fluent-community/Modules/Auth/Classes/InvitationService.php:211
fluent_community/user/password_changedCore1fluent-community/app/Http/Controllers/ProfileController.php:530

fluent_community/auth/before_auth_page_process

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Fires on the auth page after the redirect shortcuts have been evaluated but before a form is chosen.

By the time it runs, an already-signed-in visitor without an invitation has been redirected away and an auto-accepted invitation has been handled, so reaching this hook means a form is about to be rendered. It is the earliest place to short-circuit the auth page with a redirect and an exit() of your own. Both arguments can be empty: $currentUserId is 0 for a guest and $invitation is null unless a valid invitation_token was supplied.

Parameters

#NameTypeDescription
1$currentUserIdintThe signed-in user ID, or 0.
2$invitation\FluentCommunity\Modules\Auth\Classes\InvitationThe resolved, still-valid invitation, or null.

Call Sites

EditionSourceParameters
Corefluent-community/Modules/Auth/AuthModdule.php:128$currentUserId (int)
$inviation (mixed)

Example

php
add_action('fluent_community/auth/before_auth_page_process', function ($currentUserId, $invitation) {
}, 10, 2);

Related: fluent_community/auth/pre_content · fluent_community/auth/invitation

fluent_community/auth/show_invitation_for_user

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Renders the accept-invitation screen for a signed-in user who arrived with a valid invitation.

Reached only when the visitor is already logged in, the invitation is valid, and either it carries no email or its email matches the signed-in account. Core attaches InvitationHandler::showCommunityOnBoard(), so a callback of your own appends to that screen rather than replacing it. Output is echoed; it is drawn inside the auth page body from fluent_community/headless/content.

Parameters

#NameTypeDescription
1$invitation\FluentCommunity\Modules\Auth\Classes\InvitationThe invitation being accepted.
2$frameDataarrayAuth page frame data: logo, title, description, button_label.

Call Sites

EditionSourceParameters
Corefluent-community/Modules/Auth/AuthModdule.php:270$inviation (mixed)
$frameData (mixed)

Example

php
add_action('fluent_community/auth/show_invitation_for_user', function ($invitation, $frameData) {
}, 10, 2);

Related: fluent_community/auth/invitation · fluent_community/headless/content

fluent_community/invitation_created

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Fires after an email invitation to a space or course has been stored.

Fired from InvitationService::invite() once every duplicate and membership check has passed, and before the invitation email is sent — so a callback that throws will leave a stored invitation with no email behind it. The invitee's address is in message and the token in message_rendered. Link invitations take a different path and fire fluent_community/invitation_link_created instead.

Parameters

#NameTypeDescription
1$invitation\FluentCommunity\Modules\Auth\Classes\InvitationThe stored invitation; status is pending.

Call Sites

EditionSourceParameters
Corefluent-community/Modules/Auth/Classes/InvitationService.php:193$inviation (mixed)

Example

php
add_action('fluent_community/invitation_created', function ($invitation) {
}, 10, 1);

Related: fluent_community/invitation_link_created · fluent_community/create_invitation_link

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Fires after a shareable invitation link has been created for a space.

Link invitations differ from email ones: message is empty, status is active rather than pending, and meta carries the title, limit and expire_date chosen by the moderator. No email is sent. The redemption counter is kept in the row's reactions_count column, which is incremented each time someone signs up through the link.

Parameters

#NameTypeDescription
1$invitation\FluentCommunity\Modules\Auth\Classes\InvitationThe stored link invitation.

Call Sites

EditionSourceParameters
Corefluent-community/Modules/Auth/Classes/InvitationService.php:211$inviation (mixed)

Example

php
add_action('fluent_community/invitation_link_created', function ($invitation) {
}, 10, 1);

Related: fluent_community/invitation_created · fluent_community/create_invitation_link

fluent_community/user/password_changed

  • Type: action
  • Edition: Core
  • Call sites: 1
  • When it fires: Fires after a member changes their own password from the portal profile settings.

Only the self-service change fires it; a password reset through WordPress or an administrator edit does not. It runs after wp_set_password() has destroyed every session and the controller has re-issued the auth cookie for the current one, so the user is still signed in and fresh REST and AJAX nonces are minted straight after. Only the user ID is passed.

Parameters

#NameTypeDescription
1$userIdintWordPress user ID whose password changed.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/ProfileController.php:530$user->ID (int)

Example

php
add_action('fluent_community/user/password_changed', function ($userId) {
}, 10, 1);

FluentCommunity developer documentation