Code-Snippets-Functions/Execute a function on a child site/WooCommerce/bypass-logout-confirmation.txt
2018-09-26 21:08:07 -06:00

12 lines
325 B
Text

<?php
function wc_bypass_logout_confirmation() {
global $wp;
if ( isset( $wp->query_vars['customer-logout'] ) ) {
wp_redirect( str_replace( '&amp;', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) );
exit;
}
}
add_action( 'template_redirect', 'wc_bypass_logout_confirmation' );
?>