Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    You can use the pre_site_option_dm_remote_login filter to return true for the users you want to have remote login.

    Thread Starter stephentims

    (@stephentims)

    Hi, Thanks for the tip. I used the following, though it doesn’t seem to give me the desired result (enable remote login for ‘administrator’ roles). Could you take a peek and share some insight? Thanks in advance!

    function enable_remote_login() {
    	$user_id = get_current_user_id();
    	$user = new WP_User($user_id);
    	$role = array_shift($user -> roles);
    	if ($role === 'administrator') {
    		return true;
    	} else {
    		return false;
    	}
    }
    add_filter('pre_site_option_dm_remote_login', 'enable_remote_login');
    Plugin Author Ron Rennick

    (@wpmuguru)

    Returning false from a pre_site_option_ filter bypasses the filter because false is what is passed to the filter.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Remote Login by Role’ is closed to new replies.