Created
February 12, 2018 02:49
-
-
Save daniloparrajr/e1b8f275842fbc218593dc9c29696da9 to your computer and use it in GitHub Desktop.
Woocommerce Remove logout confirmation
This file contains 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 characters
/** | |
* Bypass logout confirmation. | |
*/ | |
function wc_bypass_logout_confirmation() { | |
global $wp; | |
if ( isset( $wp->query_vars['customer-logout'] ) ) { | |
wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) ); | |
exit; | |
} | |
} | |
add_action( 'template_redirect', 'wc_bypass_logout_confirmation' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://iconicwp.com/blog/bypass-are-you-sure-you-want-to-log-out-message-in-woocommerce/