Icegram User Switching 1.0.1 has 7 actions and 7 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Icegram User Switching fires an action
add_action( 'ig_sul_change_to_user', function( $user_id, $old_user_id, $new_token, $old_token ) {
// Your code runs here.
}, 10, 4 );
// Change a value Icegram User Switching is about to use
add_filter( 'ig_sul_send_auth_cookies', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Allows preventing auth cookies from actually being sent to the client. */ apply_filters( 'ig_sul_send_auth_cookies', true ); -
/** * This filter is documented in wp-includes/pluggable.php */ apply_filters( 'auth_cookie_expiration', 172800, get_current_user_id(), false ); -
/** * Fires when a user switches to another user account. */ do_action( 'ig_sul_change_to_user', $user_id, $old_user_id, $new_token, $old_token ); -
/** * Fires just before the user switching cookies are cleared. */ do_action( 'ig_sul_clear_old_user_cookie' ); -
/** * Filters the redirect location after a user switches to another account or * switches off. */ apply_filters( 'ig_sul_redirect_to', $redirect_to, $redirect_type, $new_user, $old_user ); -
/** * Fires immediately before the User Switching old user cookie is set. */ do_action( 'ig_sul_set_old_user_cookie', $old_user_cookie, $expiration, $old_user_id, $scheme, $token ); -
/** * Fires immediately before the User Switching authentication cookie is set. */ do_action( 'ig_sul_set_user_switching_cookie', $auth_cookie, $expiration, $old_user_id, $scheme, $token ); -
/** * Fires when a user switches back to their originating account. */ do_action( 'ig_sul_switch_back_user', $user_id, $old_user_id, $new_token, $old_token ); -
/** * Fires when a user switches off. */ do_action( 'ig_sul_switch_off_user', $old_user_id, $old_token ); -
/** * Filters the contents of the message that's displayed to switched users in * the admin area. */ apply_filters( 'ig_sul_switched_message', $message, $user, $old_user, $switch_back_url, $just_switched ); -
/** * This filter is documented in wp-login.php */ apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $new_user ); -
/** * This filter is documented in wp-login.php */ apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $old_user ); -
do_action( 'ig_sul_qm/cease' );
Generated from Icegram User Switching's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: