From 91f6248047e5b503db4a46f3ba1d9796ea73be86 Mon Sep 17 00:00:00 2001 From: Imran Hossain Date: Fri, 11 Aug 2023 15:46:55 +0600 Subject: [PATCH] Register lm header in init as per GB recommendation --- .../course-theme/class-sensei-course-theme-templates.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/includes/course-theme/class-sensei-course-theme-templates.php b/includes/course-theme/class-sensei-course-theme-templates.php index 0604a6331e..435e7a3e21 100644 --- a/includes/course-theme/class-sensei-course-theme-templates.php +++ b/includes/course-theme/class-sensei-course-theme-templates.php @@ -70,7 +70,7 @@ public function init() { add_filter( 'pre_get_block_file_template', [ $this, 'get_single_block_template' ], 10, 3 ); add_filter( 'theme_lesson_templates', [ $this, 'add_learning_mode_template' ], 10, 4 ); add_filter( 'theme_quiz_templates', [ $this, 'add_learning_mode_template' ], 10, 4 ); - add_action( 'sensei_course_theme_before_templates_load', [ $this, 'load_course_theme_patterns' ] ); + add_action( 'init', [ $this, 'load_course_theme_patterns' ] ); } @@ -82,13 +82,6 @@ public function init() { */ public function maybe_use_course_theme_templates() { if ( Sensei_Course_Theme_Option::should_use_learning_mode() ) { - /** - * Fires before the course theme templates are loaded. - * - * @since $$next-version$$ - */ - do_action( 'sensei_course_theme_before_templates_load' ); - add_filter( 'sensei_use_sensei_template', '__return_false' ); add_filter( 'single_template_hierarchy', [ $this, 'set_single_template_hierarchy' ] ); add_theme_support( 'block-templates' );