Skip to content

Instantly share code, notes, and snippets.

@FernandoSalinas33
Created May 4, 2018 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoSalinas33/73648f7f5f5d978e8026ab0d9add26c8 to your computer and use it in GitHub Desktop.
Save FernandoSalinas33/73648f7f5f5d978e8026ab0d9add26c8 to your computer and use it in GitHub Desktop.
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