Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Logout redirect for front-end users in WordPress, in this case Authors with access to the back end to add posts. Redirects to a front end page called 'Members Home'.
//AUTHOR LOGOUT
add_filter( 'logout_url', 'author_logout_page', 10, 2 );
function author_logout_page( $logout_url, $redirect ) {
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
return home_url( '/members-home/' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.