From 39ded2cca2565ccb0388e0ae287ce9f21374a0b3 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Sat, 19 Mar 2022 11:33:17 +0100 Subject: [PATCH] fix archives block widget --- inc/widgets.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/inc/widgets.php b/inc/widgets.php index a8116e8f..2f01e568 100644 --- a/inc/widgets.php +++ b/inc/widgets.php @@ -8,6 +8,28 @@ // Exit if accessed directly. defined( 'ABSPATH' ) || exit; +if ( ! function_exists( 'understrap_add_block_widget_archives_classes' ) ) { + /** + * Adds Bootstrap class to select tag in the Categories widget. + * + * @param string $block_content The block content. + * @param array $block The full block, including name and attributes. + * @return string The filtered block content. + */ + function understrap_add_block_widget_archives_classes( $block_content, $block ) { + + if ( isset( $block['attrs']['displayAsDropdown'] ) && true === $block['attrs']['displayAsDropdown'] ) { + return str_replace( + '