Allows developers to add their own filters to the active filters list (#36705)

This commit is contained in:
Ron Rennick 2023-03-06 13:18:04 -04:00 committed by GitHub
commit 7d62529dd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 0 deletions

4
changelog/pr-36705 Normal file
View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Added `woocommerce_widget_layered_nav_filters_start/end` hooks around layered nav filters widget

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Added `woocommerce_widget_layered_nav_filters_start/end` hooks around layered nav filters widget

View File

@ -56,6 +56,16 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget {
echo '<ul>';
/**
* Allow 3rd party developers to add their own filters to start the Layered Navigation Filters Widget.
*
* @since 7.6.0
*
* @param array $args Arguments.
* @param array $instance Widget instance.
*/
do_action( 'woocommerce_widget_layered_nav_filters_start', $args, $instance );
// Attributes.
if ( ! empty( $_chosen_attributes ) ) {
foreach ( $_chosen_attributes as $taxonomy => $data ) {
@ -105,6 +115,16 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget {
}
}
/**
* Allow 3rd party developers to add their own filters to end the Layered Navigation Filters Widget.
*
* @since 7.6.0
*
* @param array $args Arguments.
* @param array $instance Widget instance.
*/
do_action( 'woocommerce_widget_layered_nav_filters_end', $args, $instance );
echo '</ul>';
$this->widget_end( $args );