Created
June 14, 2013 15:09
Revisions
-
firefly05 created this gist
Jun 14, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // originally by Camden Ross. Thanks /* bypass wordpress are you sure you want to logout screen when logging out of an already logged out account. */ function smart_logout() { if (!is_user_logged_in()) { $smart_redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '/'; wp_safe_redirect( $smart_redirect_to ); exit(); } else { check_admin_referer('log-out'); wp_logout(); $smart_redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '/'; wp_safe_redirect( $smart_redirect_to ); exit(); } } add_action ( 'login_form_logout' , 'smart_logout' );