Skip to content

Commit

Permalink
Improve the classic block load conditions comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Jul 3, 2023
1 parent ddfec41 commit 66ed611
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,12 @@ const getAllBlocks = () => {
postAuthorBiography,
];

// Only add the classic block in WP Context
// and when either of the following is true:
// - TinyMCE experiment is disabled;
// - there is a classic block in the current post's content;
// - the query argument to require TinyMCE is set.
// When in a WordPress context, conditionally
// add the classic block and TinyMCE editor
// under any of the following conditions:
// - the current post contains a classic block
// - TinyMCE experiment hasn't been intentionally disabled
// - a query argument specifies that TinyMCE should be loaded
if (
window?.wp?.oldEditor &&
( window?.wp?.needsClassicBlock ||
Expand Down

0 comments on commit 66ed611

Please sign in to comment.