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

Conversation

renatho
Copy link
Contributor

@renatho renatho commented Apr 28, 2022

Fixes #5067

Changes proposed in this Pull Request

  • Fixes Lesson compatibility issue with Divi when Learning Mode is enabled.

Testing instructions

  1. Enable Divi Builder on Course and Lesson post types (Divi > Theme Options > Builder).
  2. Create a new Course with Learning Mode enabled, and a new Lesson within that Course. Use the default editor for both.
  3. Add some blocks to the top of the Lesson.
  4. Add a "Divi Layout" block. Create a new layout in the builder.
  5. In the Lesson editor, make sure the layout is displayed as expected (without duplicating all the editor content).
  6. Setup an env with WP 5.8, repeat the steps, and make sure you can edit the lessons properly, and they look well in the frontend.

Screenshot / Video

Screen Shot 2022-04-28 at 19 16 07

@renatho renatho added this to the 4.4.1 milestone Apr 28, 2022
@renatho renatho requested review from yscik and a team April 28, 2022 22:19
@renatho renatho self-assigned this Apr 28, 2022
Comment on lines +81 to +87
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;
}
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.

Copy link
Contributor

@aaronfc aaronfc left a comment

Choose a reason for hiding this comment

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

Works like a charm! 💪

@renatho renatho merged commit 5897dc0 into feature/post-code-freeze May 2, 2022
@renatho renatho deleted the fix/lesson-divi-compatibility-issue branch May 2, 2022 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants