Skip to content

Commit 3115abe

Browse files
authored
Merge pull request #248 from gocodebox/elementor-lesson-and-course-updates
Filter to avoid rendering blocks if we're within an Elementor or other page
2 parents 7460f64 + 678e158 commit 3115abe

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
significance: patch
2+
type: fixed
3+
entry: Hide gutenberg lifterlms blocks from rendering if the post or page was
4+
edited using Elementor.

includes/class-llms-blocks-abstract-block.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function __construct() {
6060
}
6161

6262
$this->register_meta();
63-
6463
}
6564

6665
/**
@@ -145,6 +144,10 @@ public function remove_hooks() {}
145144
*/
146145
public function render_callback( $attributes = array(), $content = '' ) {
147146

147+
if ( ! apply_filters( 'llms_render_block', true, $this ) ) {
148+
return '';
149+
}
150+
148151
$this->add_hooks( $attributes, $content );
149152

150153
ob_start();
@@ -158,7 +161,6 @@ public function render_callback( $attributes = array(), $content = '' ) {
158161
}
159162

160163
return $ret;
161-
162164
}
163165

164166
/**
@@ -171,5 +173,4 @@ public function render_callback( $attributes = array(), $content = '' ) {
171173
* @version 1.0.0
172174
*/
173175
public function register_meta() {}
174-
175176
}

0 commit comments

Comments
 (0)