From 9e717d7d49aa8ad788e63654614aaee120925079 Mon Sep 17 00:00:00 2001 From: Kevin Attfield Date: Sun, 8 Mar 2026 19:14:28 -0700 Subject: [PATCH 1/8] Fix bs_dropdown outputting duplicate class attributes Merged the user-provided class and 'dropdown-toggle' class into a single class attribute on the anchor tag generated by the bs_dropdown shortcode. Updated related PHPUnit tests to assert the valid HTML structure. Possible side effects: - Any custom JavaScript parsing the raw HTML output of this shortcode and expecting a specific invalid structure (two class attributes) will need to be updated. - CSS selectors targeting the 'dropdown-toggle' class will now correctly apply alongside any custom classes provided by the user. --- inc/bs_tabs.php | 3 ++- tests/phpunit/ShortcodeTabsTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/bs_tabs.php b/inc/bs_tabs.php index b607e17..5ea7180 100644 --- a/inc/bs_tabs.php +++ b/inc/bs_tabs.php @@ -56,7 +56,8 @@ function bs_dropdown( $params, $content=null ) { ), $params ) ); $content = preg_replace( '/
/', '', $content ); $result = ''; diff --git a/tests/phpunit/ShortcodeTabsTest.php b/tests/phpunit/ShortcodeTabsTest.php index 2d61f6d..2c77b16 100644 --- a/tests/phpunit/ShortcodeTabsTest.php +++ b/tests/phpunit/ShortcodeTabsTest.php @@ -27,7 +27,7 @@ public function test_dropdown_item() { $content = '[bs_dropdown title="Options" id="opts" class="my-drop"][bs_tab href="#opt1" title="Opt 1"][/bs_dropdown]'; $output = do_shortcode($content); $this->assertStringContainsString('