Skip to content

Actions and filters

Auth: 32 hooks.

Every hook here has a description in the source.

16 actions16 filters

action

davo_account_email_changed

Fires after an unverified user updates their email address.

Parameters of davo_account_email_changed
ParameterTypeDescription
$user_idintWordPress user ID.
$new_emailstringUpdated email address.
$old_emailstringPrevious unverified email address.
add_action
add_action( 'davo_account_email_changed', 'my_action_callback', 10, 3 );

/**
 * @param int $user_id
 * @param string $new_email
 * @param string $old_email
 */
function my_action_callback( $user_id, $new_email, $old_email ) {
	// Your code here.
}

src/domains/auth/repository.php:992, and 1 more place

action

davo_auth_account_created_by_staff

Fires after an account is created on someone's behalf.

Parameters of davo_auth_account_created_by_staff
ParameterTypeDescription
$user_idintNew account's user ID.
$creator_idintUser ID of the person who created it.
add_action
add_action( 'davo_auth_account_created_by_staff', 'my_action_callback', 10, 2 );

/**
 * @param int $user_id
 * @param int $creator_id
 */
function my_action_callback( $user_id, $creator_id ) {
	// Your code here.
}

src/domains/auth/repository.php:305

action

davo_auth_account_locked

Fires when an account is locked after too many failed sign-in attempts (15 by default).

Parameters of davo_auth_account_locked
ParameterTypeDescription
$user_idintThe locked user's ID.
$identifierstringThe rate-limit identifier that reached the threshold.
add_action
add_action( 'davo_auth_account_locked', 'my_action_callback', 10, 2 );

/**
 * @param int $user_id
 * @param string $identifier
 */
function my_action_callback( $user_id, $identifier ) {
	// Your code here.
}

src/domains/auth/services/rate-limit.php:341

filter

davo_auth_account_rate_limit_thresholds

Filters the account-wide sign-in rate limit steps. Every failed attempt against an account counts, whatever address it came from.

Parameters of davo_auth_account_rate_limit_thresholds
ParameterTypeDescription
$thresholdsarray<int, int>Failed attempts => seconds to wait. Defaults to 15 => 5 minutes, 25 => 15 minutes, 40 => 1 hour.

Returns array<int, int>

add_filter
add_filter( 'davo_auth_account_rate_limit_thresholds', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, int> $thresholds
 */
function my_filter_callback( $thresholds ) {
	// Change $thresholds as needed, then return it.
	return $thresholds;
}

src/domains/auth/services/rate-limit.php:186

filter

davo_auth_attempt_retention

Filters how long failed sign-in attempt records are kept before the daily cleanup removes them. Defaults to 7 days.

Parameters of davo_auth_attempt_retention
ParameterTypeDescription
$secondsintRetention in seconds.

Returns int

add_filter
add_filter( 'davo_auth_attempt_retention', 'my_filter_callback', 10, 1 );

/**
 * @param int $seconds
 */
function my_filter_callback( $seconds ) {
	// Change $seconds as needed, then return it.
	return $seconds;
}

src/domains/auth/crons/cleanup.php:94

filter

davo_auth_audit_retention

Filters how long the sign-in audit log is kept before the cleanup removes entries. Defaults to 365 days.

Parameters of davo_auth_audit_retention
ParameterTypeDescription
$secondsintRetention in seconds.

Returns int

add_filter
add_filter( 'davo_auth_audit_retention', 'my_filter_callback', 10, 1 );

/**
 * @param int $seconds
 */
function my_filter_callback( $seconds ) {
	// Change $seconds as needed, then return it.
	return $seconds;
}

src/domains/auth/crons/cleanup.php:105

action

davo_auth_cleanup_complete

Fires when the sign-in cleanup job finishes.

Parameters of davo_auth_cleanup_complete
ParameterTypeDescription
$deleted_tokensintNumber of expired tokens deleted.
$deleted_attemptsintNumber of old attempt records deleted.
add_action
add_action( 'davo_auth_cleanup_complete', 'my_action_callback', 10, 2 );

/**
 * @param int $deleted_tokens
 * @param int $deleted_attempts
 */
function my_action_callback( $deleted_tokens, $deleted_attempts ) {
	// Your code here.
}

src/domains/auth/crons/cleanup.php:121

action

davo_auth_email_verified

Fires after a user's email is verified.

Parameters of davo_auth_email_verified
ParameterTypeDescription
$user_idintWordPress user ID.
add_action
add_action( 'davo_auth_email_verified', 'my_action_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_action_callback( $user_id ) {
	// Your code here.
}

src/domains/auth/repository.php:750

filter

davo_auth_initial_state

Filters the initial auth state printed on the page.

Parameters of davo_auth_initial_state
ParameterTypeDescription
$statearray<string, mixed>Initial state.
$userWP_User|nullCurrent user, or null when logged out.
add_filter
add_filter( 'davo_auth_initial_state', 'my_filter_callback', 10, 2 );

/**
 * @param array<string, mixed> $state
 * @param WP_User|null $user
 */
function my_filter_callback( $state, $user ) {
	// Change $state as needed, then return it.
	return $state;
}

src/domains/auth/helpers.php:434

filter

davo_auth_ip_rate_limit_thresholds

Filters the per-address sign-in rate limit steps, which stop an attacker rotating email addresses from one address.

Parameters of davo_auth_ip_rate_limit_thresholds
ParameterTypeDescription
$thresholdsarray<int, int>Failed attempts => seconds to wait. Defaults to 20 => 1 minute, 30 => 5 minutes, 45 => 15 minutes, 70 => 1 hour.

Returns array<int, int>

add_filter
add_filter( 'davo_auth_ip_rate_limit_thresholds', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, int> $thresholds
 */
function my_filter_callback( $thresholds ) {
	// Change $thresholds as needed, then return it.
	return $thresholds;
}

src/domains/auth/services/rate-limit.php:206

filter

davo_auth_is_user_action_restricted

Filter whether an unverified user is restricted from performing a specific action scope.

Parameters of davo_auth_is_user_action_restricted
ParameterTypeDescription
$restrictedboolWhether the action is restricted.
$user_idintWordPress user ID.
$scopestringAction scope slug.
add_filter
add_filter( 'davo_auth_is_user_action_restricted', 'my_filter_callback', 10, 3 );

/**
 * @param bool $restricted
 * @param int $user_id
 * @param string $scope
 */
function my_filter_callback( $restricted, $user_id, $scope ) {
	// Change $restricted as needed, then return it.
	return $restricted;
}

src/domains/auth/helpers.php:676

filter

davo_auth_lock_duration

Filters how long a locked account stays locked before it unlocks itself. Defaults to one day.

Parameters of davo_auth_lock_duration
ParameterTypeDescription
$secondsintLock duration in seconds.

Returns int

add_filter
add_filter( 'davo_auth_lock_duration', 'my_filter_callback', 10, 1 );

/**
 * @param int $seconds
 */
function my_filter_callback( $seconds ) {
	// Change $seconds as needed, then return it.
	return $seconds;
}

src/domains/auth/services/rate-limit.php:398

action

davo_auth_login_success

This action is documented in Auth_Repository::login(). */

Passed to callbacks: $user_id$session['session_id']

add_action
add_action( 'davo_auth_login_success', 'my_action_callback', 10, 2 );

function my_action_callback( $arg1, $arg2 ) {
	// Your code here.
}

src/domains/auth/repository.php:188, and 1 more place

action

davo_auth_logout

Fires after a user logs out.

Parameters of davo_auth_logout
ParameterTypeDescription
$user_idintWordPress user ID.
$session_tokenstringThe WP session token that was destroyed.
add_action
add_action( 'davo_auth_logout', 'my_action_callback', 10, 2 );

/**
 * @param int $user_id
 * @param string $session_token
 */
function my_action_callback( $user_id, $session_token ) {
	// Your code here.
}

src/domains/auth/repository.php:473

action

davo_auth_logout_all

Fires after a user destroys all their sessions.

Parameters of davo_auth_logout_all
ParameterTypeDescription
$user_idintWordPress user ID.
add_action
add_action( 'davo_auth_logout_all', 'my_action_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_action_callback( $user_id ) {
	// Your code here.
}

src/domains/auth/repository.php:504

action

davo_auth_logout_others

Fires after a user signs out all other devices except the current one.

Parameters of davo_auth_logout_others
ParameterTypeDescription
$user_idintWordPress user ID.
$session_tokenstringThe WP session token that was preserved.
add_action
add_action( 'davo_auth_logout_others', 'my_action_callback', 10, 2 );

/**
 * @param int $user_id
 * @param string $session_token
 */
function my_action_callback( $user_id, $session_token ) {
	// Your code here.
}

src/domains/auth/repository.php:1180, and 1 more place

action

davo_auth_magic_login

Fires after a user logs in via magic link.

Parameters of davo_auth_magic_login
ParameterTypeDescription
$user_idintWordPress user ID.
add_action
add_action( 'davo_auth_magic_login', 'my_action_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_action_callback( $user_id ) {
	// Your code here.
}

src/domains/auth/repository.php:1094

filter

davo_auth_password_min_length

Filters the minimum password length. Defaults to 8.

Parameters of davo_auth_password_min_length
ParameterTypeDescription
$lengthintMinimum length in characters.

Returns int

add_filter
add_filter( 'davo_auth_password_min_length', 'my_filter_callback', 10, 1 );

/**
 * @param int $length
 */
function my_filter_callback( $length ) {
	// Change $length as needed, then return it.
	return $length;
}

src/domains/auth/helpers.php:298, and 1 more place

action

davo_auth_password_reset

Fires after a password reset is completed.

Parameters of davo_auth_password_reset
ParameterTypeDescription
$user_idintWordPress user ID.
add_action
add_action( 'davo_auth_password_reset', 'my_action_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_action_callback( $user_id ) {
	// Your code here.
}

src/domains/auth/repository.php:693

action

davo_auth_password_reset_requested

Fires when a password reset email is sent.

Parameters of davo_auth_password_reset_requested
ParameterTypeDescription
$user_idintWordPress user ID.
add_action
add_action( 'davo_auth_password_reset_requested', 'my_action_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_action_callback( $user_id ) {
	// Your code here.
}

src/domains/auth/repository.php:638, and 1 more place

filter

davo_auth_rate_limit_thresholds

Filters the sign-in rate limit steps. A user is made to wait longer after each failed attempt.

Parameters of davo_auth_rate_limit_thresholds
ParameterTypeDescription
$thresholdsarray<int, int>Failed attempts => seconds to wait. Defaults to 5 => 1 minute, 6 => 5 minutes, 7 => 15 minutes, 8 => 30 minutes, 9 => 1 hour.

Returns array<int, int>

add_filter
add_filter( 'davo_auth_rate_limit_thresholds', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, int> $thresholds
 */
function my_filter_callback( $thresholds ) {
	// Change $thresholds as needed, then return it.
	return $thresholds;
}

src/domains/auth/services/rate-limit.php:446

action

davo_auth_registered

Fires after a new user account is registered.

Parameters of davo_auth_registered
ParameterTypeDescription
$user_idintWordPress user ID.
add_action
add_action( 'davo_auth_registered', 'my_action_callback', 10, 1 );

/**
 * @param int $user_id
 */
function my_action_callback( $user_id ) {
	// Your code here.
}

src/domains/auth/repository.php:172, and 1 more place

filter

davo_auth_registration_allowed

Filters whether registration is open. Defaults to the allow_registration setting, which is off until the owner turns it on.

Parameters of davo_auth_registration_allowed
ParameterTypeDescription
$allowedboolWhether registration is allowed.

Returns bool

add_filter
add_filter( 'davo_auth_registration_allowed', 'my_filter_callback', 10, 1 );

/**
 * @param bool $allowed
 */
function my_filter_callback( $allowed ) {
	// Change $allowed as needed, then return it.
	return $allowed;
}

src/domains/auth/repository.php:88

action

davo_auth_registration_extra_save

Fires once the account exists so additional sign-up answers can be stored.

Parameters of davo_auth_registration_extra_save
ParameterTypeDescription
$user_idintNew user ID.
$validated_extraarray<string, mixed>Payload returned by davo_auth_validate_registration_extra.
add_action
add_action( 'davo_auth_registration_extra_save', 'my_action_callback', 10, 2 );

/**
 * @param int $user_id
 * @param array<string, mixed> $validated_extra
 */
function my_action_callback( $user_id, $validated_extra ) {
	// Your code here.
}

src/domains/auth/repository.php:154

action

davo_auth_security_alert_threshold

Fires when a login has failed nine times in the rate-limit window, so a security alert can be sent.

Parameters of davo_auth_security_alert_threshold
ParameterTypeDescription
$emailstringEmail address that was tried.
$ip_addressstringAddress the attempts came from.
$countintNumber of recent failed attempts.
add_action
add_action( 'davo_auth_security_alert_threshold', 'my_action_callback', 10, 3 );

/**
 * @param string $email
 * @param string $ip_address
 * @param int $count
 */
function my_action_callback( $email, $ip_address, $count ) {
	// Your code here.
}

src/domains/auth/services/rate-limit.php:326

filter

davo_auth_session_inactivity

Filters how long a session may sit inactive before the cleanup removes it. Defaults to 60 days.

Parameters of davo_auth_session_inactivity
ParameterTypeDescription
$secondsintInactivity period in seconds.

Returns int

add_filter
add_filter( 'davo_auth_session_inactivity', 'my_filter_callback', 10, 1 );

/**
 * @param int $seconds
 */
function my_filter_callback( $seconds ) {
	// Change $seconds as needed, then return it.
	return $seconds;
}

src/domains/auth/crons/cleanup.php:113

filter

davo_auth_session_location

Filters the geo-IP location resolved for a session IP address.

Return a non-empty string to supply a location. Returning an empty string (the default) causes the Sessions UI to omit the location field.

Parameters of davo_auth_session_location
ParameterTypeDescription
$locationstringEmpty string — populate via your geo-IP provider.
$ip_addressstringThe IP address to resolve.
add_filter
add_filter( 'davo_auth_session_location', 'my_filter_callback', 10, 2 );

/**
 * @param string $location
 * @param string $ip_address
 */
function my_filter_callback( $location, $ip_address ) {
	// Change $location as needed, then return it.
	return $location;
}

src/domains/auth/services/security.php:178

action

davo_auth_session_revoked

Fires after a single session has been revoked from the Sessions UI.

Parameters of davo_auth_session_revoked
ParameterTypeDescription
$user_idintWordPress user ID.
$session_idintDavo session record ID that was removed.
add_action
add_action( 'davo_auth_session_revoked', 'my_action_callback', 10, 2 );

/**
 * @param int $user_id
 * @param int $session_id
 */
function my_action_callback( $user_id, $session_id ) {
	// Your code here.
}

src/domains/auth/services/session.php:372

filter

davo_auth_staff_account_role

Filters the role given to an account created on someone's behalf.

Parameters of davo_auth_staff_account_role
ParameterTypeDescription
$rolestringRole slug. Default 'subscriber'.
$creator_idintUser ID of the person creating the account.
add_filter
add_filter( 'davo_auth_staff_account_role', 'my_filter_callback', 10, 2 );

/**
 * @param string $role
 * @param int $creator_id
 */
function my_filter_callback( $role, $creator_id ) {
	// Change $role as needed, then return it.
	return $role;
}

src/domains/auth/repository.php:266

filter

davo_auth_token_expiry

Filters how long a one-time token stays valid. Defaults are 1 hour for password reset, 1 day for email verification, 15 minutes for magic sign-in links and 30 days for remember-me.

Parameters of davo_auth_token_expiry
ParameterTypeDescription
$secondsintValidity in seconds.
$typestringToken type.

Returns int

add_filter
add_filter( 'davo_auth_token_expiry', 'my_filter_callback', 10, 2 );

/**
 * @param int $seconds
 * @param string $type
 */
function my_filter_callback( $seconds, $type ) {
	// Change $seconds as needed, then return it.
	return $seconds;
}

src/domains/auth/services/token.php:98, and 1 more place

filter

davo_auth_user_response

Filters the Davo auth user response.

Parameters of davo_auth_user_response
ParameterTypeDescription
$responsearray<string, mixed>User response payload.
$userWP_UserWordPress user object.
add_filter
add_filter( 'davo_auth_user_response', 'my_filter_callback', 10, 2 );

/**
 * @param array<string, mixed> $response
 * @param WP_User $user
 */
function my_filter_callback( $response, $user ) {
	// Change $response as needed, then return it.
	return $response;
}

src/domains/auth/helpers.php:402

filter

davo_auth_validate_registration_extra

Validates additional sign-up answers before anything is created.

Return the validated payload (opaque to Auth, handed back to davo_auth_registration_extra_save) or a WP_Error to refuse the sign-up.

Parameters of davo_auth_validate_registration_extra
ParameterTypeDescription
$validatedarray<string, mixed>Validated payload so far.
$extraarray<string, mixed>Raw additional answers from the request.
add_filter
add_filter( 'davo_auth_validate_registration_extra', 'my_filter_callback', 10, 2 );

/**
 * @param array<string, mixed> $validated
 * @param array<string, mixed> $extra
 */
function my_filter_callback( $validated, $extra ) {
	// Change $validated as needed, then return it.
	return $validated;
}

src/domains/auth/repository.php:110

Note. Generated from the plugin source. Descriptions and parameters are the ones written in the code. The starter code uses the parameter names from those comments, or generic names where there are none, so check them against your use.

See it on your own site.

Davo is a WordPress theme and plugin by Exorex.

  • Runs on your own WordPress
  • Guided setup wizard
  • AI is off until you switch it on
  • Read the licence on the marketplace first