diff --git a/includes/abstracts/abstract-wc-widget.php b/includes/abstracts/abstract-wc-widget.php index 559bf1ab9c1..4a67536ded9 100644 --- a/includes/abstracts/abstract-wc-widget.php +++ b/includes/abstracts/abstract-wc-widget.php @@ -278,13 +278,20 @@ abstract class WC_Widget extends WP_Widget { /** * Get current page URL with various filtering props supported by WC. * + * @param string $taxonomy Taxonomy. * @return string */ - protected function get_page_base_url( $deprecated ) { - if ( $deprecated ) { - wc_deprecated_argument( 'taxonomy', '3.3', 'get_page_base_url() does not require a taxonomy id anymore.' ); - } + protected function get_page_base_url( $taxonomy ) { + wc_deprecated_function( 'WC_Widget::get_page_base_url', '3.3.0', 'WC_Widget::get_page_url' ); + return $this->get_page_url(); + } + /** + * Get current page URL with various filtering props supported by WC. + * + * @return string + */ + protected function get_page_url() { if ( defined( 'SHOP_IS_ON_FRONT' ) ) { $link = home_url(); } elseif ( is_shop() ) { diff --git a/includes/widgets/class-wc-widget-layered-nav-filters.php b/includes/widgets/class-wc-widget-layered-nav-filters.php index 8abb5ff0ba3..ce45ab7e100 100644 --- a/includes/widgets/class-wc-widget-layered-nav-filters.php +++ b/includes/widgets/class-wc-widget-layered-nav-filters.php @@ -50,7 +50,7 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget { $min_price = isset( $_GET['min_price'] ) ? wc_clean( $_GET['min_price'] ) : 0; $max_price = isset( $_GET['max_price'] ) ? wc_clean( $_GET['max_price'] ) : 0; $rating_filter = isset( $_GET['rating_filter'] ) ? array_filter( array_map( 'absint', explode( ',', $_GET['rating_filter'] ) ) ) : array(); - $base_link = $this->get_page_base_url(); + $base_link = $this->get_page_url(); if ( 0 < count( $_chosen_attributes ) || 0 < $min_price || 0 < $max_price || ! empty( $rating_filter ) ) { diff --git a/includes/widgets/class-wc-widget-layered-nav.php b/includes/widgets/class-wc-widget-layered-nav.php index 66a566016e3..8460f5c8ecf 100644 --- a/includes/widgets/class-wc-widget-layered-nav.php +++ b/includes/widgets/class-wc-widget-layered-nav.php @@ -424,7 +424,7 @@ class WC_Widget_Layered_Nav extends WC_Widget { $current_filter[] = $term->slug; } - $link = remove_query_arg( $filter_name, $this->get_page_base_url() ); + $link = remove_query_arg( $filter_name, $this->get_page_url() ); // Add current filters to URL. foreach ( $current_filter as $key => $value ) { diff --git a/includes/widgets/class-wc-widget-rating-filter.php b/includes/widgets/class-wc-widget-rating-filter.php index e785c8ef93d..3e6d66a6d20 100644 --- a/includes/widgets/class-wc-widget-rating-filter.php +++ b/includes/widgets/class-wc-widget-rating-filter.php @@ -112,7 +112,7 @@ class WC_Widget_Rating_Filter extends WC_Widget { continue; } $found = true; - $link = $this->get_page_base_url(); + $link = $this->get_page_url(); if ( in_array( $rating, $rating_filter ) ) { $link_ratings = implode( ',', array_diff( $rating_filter, array( $rating ) ) );