woocommerce_logout_default_redirect_url

woocommerce_logout_default_redirect_url

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_logout_default_redirect_url') is found 2 times:

  • /includes/wc-template-functions.php line 38
    	}
    
    	// Logout.
    	if ( isset( $wp->query_vars['customer-logout'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'customer-logout' ) ) {
    		wp_safe_redirect( str_replace( '&', '&', wp_logout_url( apply_filters( 'woocommerce_logout_default_redirect_url', wc_get_page_permalink( 'myaccount' ) ) ) ) );
    		exit;
    	}
    
    	// Redirect to the correct logout endpoint.
    	if ( isset( $wp->query_vars['customer-logout'] ) && 'true' === $wp->query_vars['customer-logout'] ) {
    		wp_safe_redirect( esc_url_raw( wc_get_account_endpoint_url( 'customer-logout' ) ) );
    
  • /includes/wc-template-functions.php line 3728
     *
     * @return string
     */
    function wc_logout_url( $redirect = '' ) {
    	$redirect = $redirect ? $redirect : apply_filters( 'woocommerce_logout_default_redirect_url', wc_get_page_permalink( 'myaccount' ) );
    
    	if ( get_option( 'woocommerce_logout_endpoint' ) ) {
    		return wp_nonce_url( wc_get_endpoint_url( 'customer-logout', '', $redirect ), 'customer-logout' );
    	}
    
    	return wp_logout_url( $redirect );