Skip to content

Commit 914866f

Browse files
committed
Workaround to acommondate the deprecated change in A11y-accordion-tabs JavaScript library.
So that the tabs will continue to work in the frontend without the need for administrators to re-save it manually in the editor. matthiasott/a11y-accordion-tabs@f44bb27
1 parent dfc0fa7 commit 914866f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ubc-tabs-block.php

+15
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,18 @@ function ubc_tab_blocks_asset_load(){
7979
) );
8080
}
8181

82+
/**
83+
* Workaround to acommondate the deprecated change in A11y-accordion-tabs JavaScript library.
84+
* So that the tabs will continue to work in the frontend without the need for administrators to re-save it manually in the editor.
85+
* https://github.com/matthiasott/a11y-accordion-tabs/commit/f44bb27e2adda00e3ed72058472a1378bdd3fc05
86+
*/
87+
function apply_a11y_accordion_tabs_typo( $block_content, $block ) {
88+
89+
if ( $block['blockName'] !== 'ubc/tab' && $block['blockName'] !== 'ubc/tabs' ) {
90+
return $block_content;
91+
}
92+
93+
return str_replace( 'accordeon', 'accordion', $block_content );;
94+
95+
}
96+
add_filter( 'render_block', 'apply_a11y_accordion_tabs_typo', 10, 2 );

0 commit comments

Comments
 (0)