Skip to content

Instantly share code, notes, and snippets.

@ahmedeshaan
Created May 31, 2018 03:13
Show Gist options
  • Save ahmedeshaan/4e98e2c7b95df3868a955aae105267d5 to your computer and use it in GitHub Desktop.
Save ahmedeshaan/4e98e2c7b95df3868a955aae105267d5 to your computer and use it in GitHub Desktop.
* Bypass logout confirmation.
*/
function iconic_bypass_logout_confirmation() {
global $wp;
if ( isset( $wp->query_vars['customer-logout'] ) ) {
wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'disconnected' ) ) ) );
exit;
}
}
add_action( 'template_redirect', 'iconic_bypass_logout_confirmation' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment