From c7ad8a643ab4d214650c3fddf6215e63ed903aa1 Mon Sep 17 00:00:00 2001 From: Brian Hogg Date: Tue, 15 Apr 2025 14:19:13 -0400 Subject: [PATCH 1/2] Filter to avoid rendering blocks if we're within an Elementor (or other) page. --- includes/class-llms-blocks-abstract-block.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/class-llms-blocks-abstract-block.php b/includes/class-llms-blocks-abstract-block.php index ea35c617..95314fd1 100644 --- a/includes/class-llms-blocks-abstract-block.php +++ b/includes/class-llms-blocks-abstract-block.php @@ -60,7 +60,6 @@ public function __construct() { } $this->register_meta(); - } /** @@ -145,6 +144,10 @@ public function remove_hooks() {} */ public function render_callback( $attributes = array(), $content = '' ) { + if ( ! apply_filters( 'llms_render_block', true, $this ) ) { + return ''; + } + $this->add_hooks( $attributes, $content ); ob_start(); @@ -158,7 +161,6 @@ public function render_callback( $attributes = array(), $content = '' ) { } return $ret; - } /** @@ -171,5 +173,4 @@ public function render_callback( $attributes = array(), $content = '' ) { * @version 1.0.0 */ public function register_meta() {} - } From 678e158b1760ff510498255a0771bc8ccffdd23d Mon Sep 17 00:00:00 2001 From: Brian Hogg Date: Wed, 16 Apr 2025 11:43:13 -0400 Subject: [PATCH 2/2] Changelog --- .changelogs/elementor-lesson-and-course-updates.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changelogs/elementor-lesson-and-course-updates.yml diff --git a/.changelogs/elementor-lesson-and-course-updates.yml b/.changelogs/elementor-lesson-and-course-updates.yml new file mode 100644 index 00000000..8fade166 --- /dev/null +++ b/.changelogs/elementor-lesson-and-course-updates.yml @@ -0,0 +1,4 @@ +significance: patch +type: fixed +entry: Hide gutenberg lifterlms blocks from rendering if the post or page was + edited using Elementor.