Skip to content

Instantly share code, notes, and snippets.

@ahmedeshaan
Created September 21, 2017 03:00
Show Gist options
  • Select an option

  • Save ahmedeshaan/dbeb4b2fbaf52755fb37f209f643be32 to your computer and use it in GitHub Desktop.

Select an option

Save ahmedeshaan/dbeb4b2fbaf52755fb37f209f643be32 to your computer and use it in GitHub Desktop.
<?php
// Logout without 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( 'myaccount' ) ) ) );
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