From 502391a5a96547dcc4092fcb4dee78c665004bdf Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Wed, 6 Nov 2024 16:07:50 -0300 Subject: [PATCH] Don't load learning mode styles on course pages --- includes/3rd-party/themes/astra.php | 2 +- includes/3rd-party/themes/course.php | 2 +- includes/3rd-party/themes/divi.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/3rd-party/themes/astra.php b/includes/3rd-party/themes/astra.php index fea5a4d201..311c2391e2 100644 --- a/includes/3rd-party/themes/astra.php +++ b/includes/3rd-party/themes/astra.php @@ -12,7 +12,7 @@ function sensei_load_learning_mode_styles_for_astra_theme() { $course_id = Sensei_Utils::get_current_course(); $is_target_theme = 'astra' === strtolower( wp_get_theme()->get_template() ); - if ( empty( $course_id ) || ! $is_target_theme ) { + if ( empty( $course_id ) || ! $is_target_theme || 'course' === get_post_type() ) { return false; } diff --git a/includes/3rd-party/themes/course.php b/includes/3rd-party/themes/course.php index 1b7e1d257d..70c3ecf35b 100644 --- a/includes/3rd-party/themes/course.php +++ b/includes/3rd-party/themes/course.php @@ -12,7 +12,7 @@ function sensei_load_learning_mode_style_for_course_theme() { $course_id = Sensei_Utils::get_current_course(); $is_course_theme = 'course' === wp_get_theme()->get_template(); - if ( empty( $course_id ) || ! $is_course_theme ) { + if ( empty( $course_id ) || ! $is_course_theme || 'course' === get_post_type() ) { return false; } diff --git a/includes/3rd-party/themes/divi.php b/includes/3rd-party/themes/divi.php index 357c4542d0..e63dc1fd43 100644 --- a/includes/3rd-party/themes/divi.php +++ b/includes/3rd-party/themes/divi.php @@ -97,7 +97,7 @@ function sensei_load_learning_mode_style_for_divi_theme() { $course_id = Sensei_Utils::get_current_course(); $is_target_theme = 'divi' === strtolower( wp_get_theme()->get_template() ); - if ( empty( $course_id ) || ! $is_target_theme ) { + if ( empty( $course_id ) || ! $is_target_theme || 'course' === get_post_type() ) { return false; }