Allows developers to add their own filters to the active filters list

Fixes #36704
This commit is contained in:
Marco Almeida 2023-01-31 19:02:17 +00:00 committed by GitHub
parent ab0378634a
commit 53f80a24f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,8 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget {
$this->widget_start( $args, $instance ); $this->widget_start( $args, $instance );
echo '<ul>'; echo '<ul>';
do_action( 'woocommerce_widget_layered_nav_filters_start' );
// Attributes. // Attributes.
if ( ! empty( $_chosen_attributes ) ) { if ( ! empty( $_chosen_attributes ) ) {
@ -104,6 +106,8 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget {
echo '<li class="chosen"><a rel="nofollow" aria-label="' . esc_attr__( 'Remove filter', 'woocommerce' ) . '" href="' . esc_url( $link ) . '">' . sprintf( esc_html__( 'Rated %s out of 5', 'woocommerce' ), esc_html( $rating ) ) . '</a></li>'; echo '<li class="chosen"><a rel="nofollow" aria-label="' . esc_attr__( 'Remove filter', 'woocommerce' ) . '" href="' . esc_url( $link ) . '">' . sprintf( esc_html__( 'Rated %s out of 5', 'woocommerce' ), esc_html( $rating ) ) . '</a></li>';
} }
} }
do_action( 'woocommerce_widget_layered_nav_filters_end' );
echo '</ul>'; echo '</ul>';