Skip to content

Commit

Permalink
fix uncaught error in content toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-shafi committed Apr 30, 2024
1 parent 2b9964d commit f8fd641
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/blocks.build.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ That's it. You're done!

= 3.1.8 =

* NEW: Block Spacing in button block.
* FIX: Slides per view not working properly in the frontend in image slider block.
* IMPROVE: Add flex wrap on content filter buttons.
* FIX: Uncaught Error on content toggle block.
* NEW: Block Spacing in button block.
* NEW: Icon spacing in divider block.
* IMPROVE: Add flex wrap on content filter buttons.
* IMPROVE: Width control in divider block.

= 3.1.7 =
Expand Down
8 changes: 5 additions & 3 deletions src/blocks/content-toggle/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ function ub_content_toggle_filter( $block_content, $block ) {
$block_content
)
);

$panel = $parsedBlockContent->find( '.toggleroot>.wp-block-ub-content-toggle-accordion>.wp-block-ub-content-toggle-accordion-content-wrap' );

$panel = array();

if( !empty($parsedBlockContent) && gettype($parsedBlockContent) !== "boolean" ){
$panel = $parsedBlockContent->find( '.toggleroot>.wp-block-ub-content-toggle-accordion>.wp-block-ub-content-toggle-accordion-content-wrap' );
}
foreach ( $panel as $elem ) {
// look for possible nested content toggles and remove existing ones
foreach ( $elem->find( '.wp-block-ub-content-toggle' ) as $nestedToggle ) {
Expand Down

0 comments on commit f8fd641

Please sign in to comment.