Created
February 10, 2021 13:36
-
-
Save ivanmercedes/868e4c470375445ef4ad88139d17cde0 to your computer and use it in GitHub Desktop.
Remove WooCommerce Logout Confirmation with Template Redirect
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 characters
| <?php | |
| //The following is the code that you should add to the functions.php | |
| //file of your theme to remove the WooCommerce logout confirmation message: | |
| add_action( 'template_redirect', 'logout_confirmation' ); | |
| function logout_confirmation() { | |
| global $wp; | |
| if ( isset( $wp->query_vars['customer-logout'] ) ) { | |
| wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) ); | |
| exit; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment