From 224a95ae4d453e8a923be3031b141b9e851c1b21 Mon Sep 17 00:00:00 2001 From: Mauro Pereira Date: Sat, 8 Aug 2026 10:44:59 +0100 Subject: [PATCH] fix: force course item block template --- inc/Gutenberg/GutenbergHandleMain.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/Gutenberg/GutenbergHandleMain.php b/inc/Gutenberg/GutenbergHandleMain.php index fc3f5818f1..f7f2d51f85 100644 --- a/inc/Gutenberg/GutenbergHandleMain.php +++ b/inc/Gutenberg/GutenbergHandleMain.php @@ -142,7 +142,7 @@ public function register_blocks() { * * @return array * @since 4.2.2.3 - * @version 1.0.6 + * @version 1.0.7 */ public function set_blocks_template( array $query_result, array $query, $template_type ): array { if ( $template_type === 'wp_template_part' ) { // Template not Template part @@ -161,6 +161,8 @@ public function set_blocks_template( array $query_result, array $query, $templat $lp_course_item = learn_press_get_post_by_name( $vars['course-item'] ?? '', $item_type ); $item_types = CourseModel::item_types_support(); if ( $lp_course_item && in_array( $lp_course_item->post_type, $item_types ) ) { + // Course items use their own template, not a course-level theme or post template. + $query_result = []; $singleCourseItemBlockTemplate = new SingleCourseItemBlockTemplate(); $block_custom = $this->is_custom_block_template( $template_type, $singleCourseItemBlockTemplate->slug ); if ( $block_custom ) {