I got it to work as follows — in mu-plugins directory, my superAdmin.php script looks like this:
<?php
function check_for_superAdmin($user_login, $user) {
$current_user = get_userdatabylogin($user_login);
if ( is_super_admin( $current_user->ID ) ) { // do these things }
else { // do other things }
}
add_action( 'wp_login', 'check_for_superAdmin', 10, 2 );
?>
Hope this helps someone wanting to hook the same way.
Related Posts:
- Multisite Admin Roles
- How do I get the current edit page ID in the admin?
- Modify Admin Bar Link
- How to remove row-actions from pages table?
- Is it possible to remove the main rich Text box editor?
- Add admin bar link to edit author
- Apply custom role capabilities to administrator (without plugin)
- Roles & capabilities GUI that does not create separate table
- Replacing select2 in admin backend for all selects
- echo or print_r in an admin function
- Can I remove the Rich Text box editor for a specific post?
- How do I redirect upon login a specific user based on role?
- How to add another user to this remove_menu function?
- Allow role to delete posts but block him the wp-admin
- Add a new subscriber role using a function
- How to add a column to the Trash page?
- Delete pages and Create default pages for all new network sites
- Custom roles can’t access to wp-admin
- Custom registration URL lost when user makes signup mistake
- Custom function for specific user role
- Hide Author.php template from specific user role
- edit role display name and label name without plugins
- How to select a page within admin?
- Change Admin Bar “Visit Site” URL
- create shortcode to list users with specific meta key value
- Toggle User Roles with button
- How to Display Frontend CSS for Administrator only
- Hard-coding custom menu elements for menu manager
- How to change or add user role after getting post request data about pay? [closed]
- How to make custom column Admin>Users sortable?
- Trigger a custom function when option are saved in admin area
- Execute a ultimate member action when user role is updated
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Allowing users to view private posts (pending approval)
- Allow Contributor to edit their own posts after Adm aproval
- How to add custom JavaScript in functions?
- How to set default post editor based on role?
- load CSS only for administrators on backend
- Adding additional roles on registration
- The Capability to choose post/page template
- Logout Redirect and also WP-login.php Redirect
- How to add array [closed]
- what is best way to keep track of changes made in wordpress website? [closed]
- WordPress wraps span tags into p tags
- Get users with different roles and call function on each of them (user_meta)
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- How can I show different content for different user-levels?
- Custom user role still showing up after deletion, ideas?
- Removing WPML Items From the WordPress Admin Bar
- Show metadata in users.php – wordpress
- How to load a css file depending on the current role
- How to display my comment count in the wordpress admin bar?
- Allow user select role in wordpress default registration without plugin
- Admin users not able to see network menus
- Remove check boxes and its label from screen option for custom role
- Add Change role button for list of user in an event
- How to show only specific category post by user role without plugin and restrict all other cats
- Change user role based on total number of items ordered
- Remove all video attachment, both files and post/postmeta from database?
- delete_user_meta for user in spesific group
- Change the second role depending on the first
- Restrict certain roles registrations by domain
- add_role menu pages are not visible
- function to return comma separated list of meta values
- Screen Options WordPress WYSIWYG
- Welcome Mails based on user role
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Would it be possible to disable embeds for specific user roles? If so, how?
- How to make my logged-in user-role shortcode displaying name instead of slug?
- How to sort a non-meta field in the User Admin Panel?
- How to remove administrator role in settings -> general -> New User Default Role?
- How can I add an extra WooCommerce hook
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Make certain pages uneditable by editors?
- display public excerpt for private post
- automatically adding submenu items
- How do I call wp_mail from HTML?
- wp_link_pages: display current page number only if has multiple page breaks?
- Adjust which tempalte a page uses with a function?
- How to specify which Gutenberg blocks are available in the editor for a page template
- wpautop – disable tags, keep tags
- How do I pass arguments for multiple functions hooked to a single action?
- Theme functions.php file auto delete everyday [closed]
- Two Types of settings in WP – The Doubt
- Exclude category from shortcode
- Undefined variable error in new function
- Passing Jquery value to WordPress function
- How to pass variables from one function to another or combine functions
- Unable to add extra elements to the main navi (wp_nav_menu_items)
- Internet Explorer opens links to .msi files as text in a new tab
- call wp_insert_user in custom class doesnt work
- Show number of sold products but be first for less than 2
- Class::$template_dir_path=get_template_directory();
- admin-ajax.php & my wp-admin folder url showing in header
- Gravity Forms After Submission – GFFormsModel::update_lead_field_value?
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- Missing argument 2
- Using input_attrs() Multiple Times Within One Customizer Control
- comments_template() doesn’t work with ajax call