Hallo,
kann mir jemand helfen die nachfolgende Funktion so anpassen, dass man nach dem Einloggen auf der aktuellen Seite bleibt und nach dem Abmelden auf die in meiner Signatur verlinkte Seite umgeleitet wird.
Bei meiner Seite handelt es sich um eine Multisite-Installation, auf der Hauptseite klappt es bereits so wie oben beschrieben, nur auf der Unterseite will es einfach nicht funktionieren.
LG avals
[COLOR=#66D9EF]function[/COLOR] only_admins_login_area( $redirect_to, $request, $user ) {
[COLOR=#66D9EF]global[/COLOR] $user;
[COLOR=#66D9EF]if[/COLOR] ( isset( $user->[COLOR=#F92672]roles[/COLOR] ) && is_array( $user->[COLOR=#F92672]roles[/COLOR] ) )
{
[COLOR=#708090] //check for admins
[/COLOR] [COLOR=#66D9EF]if[/COLOR] ( in_array( [COLOR=#A6E22E]'administrator'[/COLOR], $user->[COLOR=#F92672]roles[/COLOR] ) )
{
[COLOR=#708090] // Redirect to default admin area
[/COLOR] [COLOR=#66D9EF]return[/COLOR] $redirect_to;
}
}
[COLOR=#66D9EF]return[/COLOR] home_url();
}
add_filter( [COLOR=#A6E22E]'login_redirect'[/COLOR], [COLOR=#A6E22E]'only_admins_login_area'[/COLOR], [COLOR=#AE81FF]10[/COLOR], [COLOR=#AE81FF]3[/COLOR] );