From 3c9c3be02194479cfd42672ef722743be67835af Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:01:52 +1200 Subject: [PATCH 1/3] Layouts Block: Don't add Content Filter Attributes on Frontend These are added to help with rendering the actual Page Builder, not the layout. --- compat/layout-block.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compat/layout-block.php b/compat/layout-block.php index 46439ca3..dfd322d3 100644 --- a/compat/layout-block.php +++ b/compat/layout-block.php @@ -124,10 +124,18 @@ public function render_layout_block( $attributes, $content = null ) { }; $is_editing = SiteOrigin_Panels_Admin::is_block_editor(); - add_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); + + if ( $is_editing ) { + add_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); + } + SiteOrigin_Panels_Post_Content_Filters::add_filters( true ); $rendered_layout = SiteOrigin_Panels::renderer()->render( $builder_id, ! $is_editing, $panels_data ); - SiteOrigin_Panels_Post_Content_Filters::remove_filters( true ); + + if ( $is_editing ) { + SiteOrigin_Panels_Post_Content_Filters::remove_filters( true ); + } + remove_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); if ( is_wp_error( $rendered_layout ) ) { From 418c474f93ae6c3cc556c8aa356d66a89d8f8fe3 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:02:58 +1200 Subject: [PATCH 2/3] Fix typo --- compat/layout-block.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compat/layout-block.php b/compat/layout-block.php index dfd322d3..e861eb85 100644 --- a/compat/layout-block.php +++ b/compat/layout-block.php @@ -125,11 +125,12 @@ public function render_layout_block( $attributes, $content = null ) { $is_editing = SiteOrigin_Panels_Admin::is_block_editor(); + add_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); + if ( $is_editing ) { - add_filter( 'siteorigin_panels_layout_classes', $add_custom_class_name ); + SiteOrigin_Panels_Post_Content_Filters::add_filters( true ); } - SiteOrigin_Panels_Post_Content_Filters::add_filters( true ); $rendered_layout = SiteOrigin_Panels::renderer()->render( $builder_id, ! $is_editing, $panels_data ); if ( $is_editing ) { From 0098abd010f5e774d55422729b80b95dc88c4d8d Mon Sep 17 00:00:00 2001 From: Andrew Misplon Date: Mon, 30 Sep 2024 20:24:52 +0100 Subject: [PATCH 3/3] Changelog update --- readme.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.txt b/readme.txt index a5b20577..2c57e3a1 100644 --- a/readme.txt +++ b/readme.txt @@ -121,6 +121,9 @@ SiteOrigin offers a single premium plugin that enhances and extends Page Builder == Changelog == += 2.29.22 – 30 September 2024 = +* Layout Block: Removed content filter attributes from the front-end. + = 2.29.21 – 17 September 2024 = * Prebuilt Local Layouts: Resolved a potential error. * Prebuilt Local Layouts: Restricted layout files to JSON.