Developer hooks

Use WordPress filters and actions to extend authentication, account data, and settings.

Simple LDAP Login keeps its legacy hook names and adds hooks for directory modules and account management. These docs describe version 2.0.1. Put custom code in a site plugin. Register callbacks before login and set the accepted argument count when a callback needs more than one argument. Filters must return the value described below. Test it with password login, SSO, tests, and scheduled jobs as applicable.

Shared filters

FilterPurpose
sll_get_settingFilter one setting value. Receives value and setting key.
sll_force_ldapLegacy recovery policy. Its inverted meaning is kept: false requires LDAP. It applies to legacy recovery mode.
sll_remove_default_authentication_hookControls local fallback policy. It no longer removes core or third-party authentication filters.
sll_ldap_authReceives a boolean bind result for password login and server SSO, including failed binds. Return false to reject it. A callback cannot make a failed bind or invalid identity valid.
sll_user_has_groupsFilters the group access result.
sll_ldap_attributesAdd directory attributes needed by a module. Attribute names are validated.
sll_ldap_entryAdd checked directory data after group access passes. Receives the entry array, connection, directory model, and login name.
sll_user_dataReturn the new account data array before creation. It includes user_login, user_nicename, user_pass, user_email, display_name, first_name, last_name, user_url, and role. The local password is random. This filter runs only for new accounts.
sll_user_meta_data( $values )Return metadata names and scalar values, or false to skip writes. Available in Free without a license. Free supplies an empty array; an active paid plan supplies automatic LDAP mapping values first.
sll_mapped_user_meta_data( $values, $entry )Supplies initial metadata before sll_user_meta_data. The paid module uses this hook for automatic mappings. Use sll_user_meta_data for an integration that supplies custom values.
sll_ldap_hosts( $hosts, $settings )Return server addresses. Free supplies the primary server. The licensed paid module supplies backup servers.
sll_account_verifiedReject an identity before account update actions. Receives the WordPress user and entry.
sll_settings_defaultsAdd module defaults.
sll_validate_settingValidate a module setting. Receives prior result, key, submitted value, and settings service.

Metadata filter in Free

sll_user_meta_data works in Free without a license. Integrations can return custom values through this filter. Automatic LDAP-to-user-meta mapping requires an active Pro or Enterprise license.

Register a callback in an integration plugin:

add_filter( 'sll_user_meta_data', function ( $values ) {
    $values['directory_source'] = 'staff';
    return $values;
} );

With the default suffixes, this writes directory_source_ldap and directory_source_wp. Saved suffixes from earlier versions remain in use. Local edits to the WordPress value stay until the callback's source value changes. Protected account keys and non-scalar values are rejected. Selected recovery accounts do not receive these updates.

Return false to skip all metadata writes. The filter still runs without saved mappings and with a missing, inactive, or expired paid license. In those states it receives an empty array. Automatic mappings need an active paid license. See custom user metadata for storage rules and the paid mapping editor.

Shared actions

ActionWhen it runs
sll_loadedServices are ready. Receives settings and authentication services.
sll_account_loadedA verified directory entry resolves to a WordPress user. Receives user and entry. It can run outside an interactive login.
sll_auth_successVerified LDAP password or server SSO authentication reaches a new or existing account. Receives the user. Use WordPress wp_login to observe completed WordPress logins.
sll_auth_failureLDAP password authentication fails.
sll_settings_savedSettings are saved. Receives settings service and before/after arrays.

Pro hooks

sll_pro_groups adds groups needed by Pro role or membership rules.

Pro actions include sll_sso_failed, sll_profile_update, sll_import_finished, sll_account_imported, sll_access_check_failed, sll_access_changed, and sll_membership_changed. These report results from the matching feature. Review the source signatures before you attach a callback.

Settings screen hooks

sll_settings_tabs filters the tab names. sll_settings_notices adds notices. To add content, use sll_access_settings, sll_profile_settings, or sll_advanced_settings. The three section actions receive the admin form service. The notices action receives no arguments.

For a new tab, sll_settings_tab_{tab} adds content inside the standard settings form. sll_settings_page_{tab} supplies a complete page instead. Add defaults and validation for new settings, and keep WordPress permission and request checks in place.

Compatibility limits

A compatibility class provides the old global object and its settings methods. The old adLDAP object and directory administration methods are no longer available. The settings option remains sll_settings.

Directory login requires a unique verified user, a valid password or trusted server identity, and permitted groups. Keep those checks at the directory boundary. Do not call a remote license service during login; the plugin reads the saved status.

These hooks run locally. They do not send data to an external service by themselves.