Avoids redirect caused by some custom permalink structures.

This commit is contained in:
Mauricio Urrego 2021-03-18 14:51:09 +01:00
parent e62f20b9b3
commit 26c7e238f6
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
if ( '' === get_option( 'permalink_structure' ) ) {
$form_action = remove_query_arg( array( 'page', 'paged' ), add_query_arg( $wp->query_string, '', home_url( $wp->request ) ) );
} else {
$form_action = preg_replace( '%\/page/[0-9]+%', '', home_url( trailingslashit( $wp->request ) ) );
$form_action = preg_replace( '%\/page/[0-9]+%', '', home_url( user_trailingslashit( $wp->request ) ) );
}
echo '<form method="get" action="' . esc_url( $form_action ) . '" class="woocommerce-widget-layered-nav-dropdown">';