From c4afd53749c128afb61d0e00fd6e22d46c8fcea5 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 31 Jul 2019 20:57:55 -0300 Subject: [PATCH] Make wc_get_endpoint_url() compatible with WordPress use_trailing_slashes settings --- includes/wc-page-functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/wc-page-functions.php b/includes/wc-page-functions.php index 1b6c8220cd3..230fab498b9 100644 --- a/includes/wc-page-functions.php +++ b/includes/wc-page-functions.php @@ -101,10 +101,12 @@ function wc_get_endpoint_url( $endpoint, $value = '', $permalink = '' ) { } else { $query_string = ''; } - $url = trailingslashit( $permalink ) . trailingslashit( $endpoint ); + $url = trailingslashit( $permalink ); if ( $value ) { - $url .= trailingslashit( $value ); + $url .= trailingslashit( $endpoint ) . user_trailingslashit( $value ); + } else { + $url .= user_trailingslashit( $endpoint ); } $url .= $query_string;