SAML SP Premium Plugin Hooks Documentation
WordPress Hooks
WP Actions
1. user_register
do_action( 'user_register', string $user_id );
Description
Fires when a new user is registered on WordPress during Single Sign-On (SSO). This action allows you to perform tasks immediately after a user is registered on the site.
Parameters
- $user_id
string
User ID
2. wp_login
do_action( 'wp_login', string $user_login, WP_User $user );
Description
Fires after the user is successfully logged in via Single Sign-On (SSO). This allows you to perform actions just after a user is logged in to the site.
Parameters
- $user_login
string
Username - $user
WP_User
WP_User object of the logged-in user.
WP Filters
1. pre_user_login
apply_filters( 'pre_user_login', string $sanitized_userName );
Description
Fires just before the user’s username is searched in WordPress for login. This allows you to modify the username (received from the SAML Response) before user login or register.
Parameters
- $sanitized_userName
string
Sanitized Username
Custom Hooks
Actions
1. mo_abr_filter_login
do_action( 'mo_abr_filter_login', array $attrs, string $nameId, string $sessionIndex )
Description
Fires just before the user is logged in to WordPress via SSO. This allows you to perform actions before the user has logged in and also provides all the user attributes received from the IDP.
Parameters
- $attrs
array
Contains an array of attributes received from the IDP in the SAML Response. - $nameId
string
NameId received from the IDP. - $sessionIndex
string|NULL
The session index of the user on the WP site.
2. mo_saml_attributes
do_action( 'mo_saml_attributes', string $user_name, string $user_email, string $first_name, string $last_name, string $group_value );
Description
Fires after a user is created/updated in WordPress for SSO. This allows you to perform actions after the user has logged in and also provides the basic user attributes received from the IDP.
Parameters
- $userName
string
User's Username - $user_email
string
User's Email - $firstName
string
User's First Name - $lastName
string
User's Last Name - $groupName
string
User's Group Name
Filters
1. mo_remember_me
apply_filters( 'mo_remember_me', boolean $remember );
Description
Fires just before setting the WP authentication cookie. This enables you to maintain user login status by keeping the session intact (passing remember me as true).
Parameters
- $remember
boolean
The value of the remember me checkbox from the login page.
2. mo_saml_add_custom_css_in_sso_button
apply_filters( 'mo_saml_add_custom_css_in_sso_button', $html );
Description
Fires just before the SSO Login Button is loaded on the WordPress login page. This allows you to customize the SSO Login button.
Parameters
- $html
HTML body
The current html element of the SSO button as saved in the plugin settings.
For more information visit our WordPress SSO page.