Hide Dashboard with Ultimate Facebook

This simple function for hide dashboard is incompatible with this plugin, when I try to login with ultimate facebook, The login does not work and I’m redirected to home.

Do you know why? Is there any way to modify the plugin or my function to make them compatible?


function ff_restrict_dashboard_access(){

if (!is_admin())

return ”;

elseif ((is_admin()) && (!current_user_can( ‘manage_options’ ))){

$customRedirectSettings = get_option(‘customRedirectSettings’,’not_found’:wink:;

if ($customRedirectSettings != ‘not_found’:wink:{

if (($customRedirectSettings == ‘yes’:wink: && (trim($customRedirectSettings) != ”:wink:){

$redirectLink = trim($customRedirectSettings);

$findHttp = strpos($redirectLink, ‘http’:wink:;

if ($findHttp === false)

$redirectLink = ‘http://’.$redirectLink;

wp_redirect( $redirectLink );

exit;

}

}

}

}

add_action(‘admin_init’,’ff_restrict_dashboard_access’:wink:;