Merge pull request #29422 from Mauricio-Urrego/fix/issue-29421

Avoids redirect caused by some custom permalink structures.
This commit is contained in:
Roy Ho 2021-04-08 13:24:59 -07:00 committed by GitHub
commit 72cc2c2a50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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">';