Admin bypass
-
I have created a plugin to bypass the admin role but it does not work, admin still limited..
here is the code I used:
<?php function pcl_bypass_roles( $user_id ) { $whitelist = array( 'administrator', 'editor' ); // Provide an array of roles to bypass $user = get_userdata( $user_id ); $roles = empty( $user->roles ) ? array() : $user->roles; $intersect = array_intersect( $roles, $whitelist ); if ( ! empty( $intersect ) ) { return false; } return true; } add_filter( 'pcl_prevent_concurrent_logins', 'pcl_bypass_roles' ); ?>
https://www.ads-software.com/plugins/prevent-concurrent-logins/
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Admin bypass’ is closed to new replies.