Created
June 18, 2014 15:38
-
-
Save Welland/d4c106e38f349bd68c6a to your computer and use it in GitHub Desktop.
WooCommerce - Logout URL
This file contains 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
$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' ); | |
if ( $myaccount_page_id ) { | |
$logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) ); | |
//make ssl if needed | |
if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) | |
$logout_url = str_replace( 'http:', 'https:', $logout_url ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment