Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lesson compatibility issue with Divi #5082

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion includes/course-theme/class-sensei-course-theme-compat.php
Expand Up @@ -77,6 +77,14 @@ public function the_course_theme_layout() {
* @return string The wrapper template path.
*/
public function get_wrapper_template( $template ) {
// Fix compatibility issue with Divi builder.
if (
class_exists( 'ET_GB_Block_Layout' )
&& method_exists( 'ET_GB_Block_Layout', 'is_layout_block_preview' )
&& ET_GB_Block_Layout::is_layout_block_preview()
) {
return $template;
}
Comment on lines +81 to +87
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Should be fine for the editor, we only need to load the template wrapper on the frontend, to render block templates.


if ( ! preg_match( '/template-canvas.php$/', $template ) ) {
return Sensei_Course_Theme::instance()->get_course_theme_root() . '/index.php';
Expand Down Expand Up @@ -127,7 +135,7 @@ private function get_the_block_template_html( $template_content ) {
/**
* Get custom logo from the original theme's customize settings if it was not found already.
*
* @param string $custom_logo
* @param string $custom_logo Custom logo.
*
* @return string
*/
Expand Down