Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/KAD-4165_escape-attr
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh authored Feb 24, 2025
2 parents b0486a5 + 013323c commit 3587706
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/readme.txt'
- '**/*.txt'
- '.github/**'
push:
branches:
- master
paths-ignore:
- '**/readme.txt'
- '**/*.txt'
- '.github/**'
jobs:
test:
Expand Down
34 changes: 7 additions & 27 deletions includes/class-kadence-blocks-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,36 +212,16 @@ public function render_pane_scheme_head( $block ) {
$allowed_tags = apply_filters( 'kadence_blocks_faq_schema_allowed_tags', '<a><strong><br><h2><h3><h4><h5><ul><li><ol><p>', $block );
if ( ! is_null( self::$faq_schema ) ) {
if ( is_array( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) ) {
//an accordion pane has it's "question" in the pane's innerhtml
//the "answer" is everything in innerblocks
//here we parse that out and build the question and answer

$answer = '';
foreach ( $block['innerBlocks'] as $inner_key => $inner_block ) {
if ( ! empty( $inner_block['innerHTML'] ) ) {
$inner_html = trim( strip_tags( $inner_block['innerHTML'], $allowed_tags ) );
if ( ! empty( $inner_html ) ) {
$answer .= $inner_html;
}
}
if ( isset( $inner_block['innerBlocks'] ) && is_array( $inner_block['innerBlocks'] ) && ! empty ( $inner_block['innerBlocks'] ) ) {
foreach ( $inner_block['innerBlocks'] as $again_inner_key => $again_inner_block ) {
if ( ! empty( $again_inner_block['innerHTML'] ) ) {
$inner_html = trim( strip_tags( $again_inner_block['innerHTML'], $allowed_tags ) );
if ( ! empty( $inner_html ) ) {
$answer .= $inner_html;
}
}
if ( isset( $again_inner_block['innerBlocks'] ) && is_array( $again_inner_block['innerBlocks'] ) && ! empty ( $again_inner_block['innerBlocks'] ) ) {
foreach ( $again_inner_block['innerBlocks'] as $again_again_inner_key => $again_again_inner_block ) {
if ( ! empty( $again_again_inner_block['innerHTML'] ) ) {
$inner_html = trim( strip_tags( $again_again_inner_block['innerHTML'], $allowed_tags ) );
if ( ! empty( $inner_html ) ) {
$answer .= $inner_html;
}
}
}
}
}
}
$answer .= trim( strip_tags( render_block($inner_block), $allowed_tags ) );
}
preg_match( '/<span class="kt-blocks-accordion-title">(.*?)<\/span>/s', $block['innerHTML'], $match );

preg_match( '/<span class="kt-blocks-accordion-title">(.*?)<\/span>/s', do_blocks($block['innerHTML']), $match );
$question = ( $match && isset( $match[1] ) && ! empty( $match[1] ) ? $match[1] : '' );

$question = apply_filters( 'kadence_blocks_faq_schema_question', $question, $block );
Expand Down
2 changes: 1 addition & 1 deletion languages/kadence-blocks.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-02-24T16:02:35+00:00\n"
"POT-Creation-Date: 2025-02-17T18:37:49+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: kadence-blocks\n"
Expand Down
4 changes: 3 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ Please report security bugs found in the Kadence Blocks plugin's source code thr

= 3.4.10 =
Release Date: TBD February 2025

* Update: FAQ Schema for accordions now processes dynamic content.
* Fix: Warning handled for CSS class.
* Fix: Gallery (Adv) arrow strings added to pot file.

= 3.4.9 =
Release Date: 11th February 2025
Expand Down

0 comments on commit 3587706

Please sign in to comment.