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
[Widgets editor] Load custom block assets #25826
Conversation
|
Size Change: 0 B Total Size: 1.18 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Giving you the ✅ so you can merge after addressing mine and Timothy's small comments.
Are we able to use this new filter to simplify any of gutenberg_widgets_init? Or would we have to wait until Gutenberg requires WordPress 5.6?
lib/widgets-page.php
Outdated
| * @param bool $is_block_editor_screen Current decision about loading block assets. | ||
| * @return bool Filtered decision about loading block assets. | ||
| */ | ||
| function widgets_editor_load_block_editor_scripts_and_styles( $is_block_editor_screen ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convention says this should start with gutenberg_ (e.g. gutenberg_should_load_block_editor_scripts_and_styles) because it's a function added by the Gutenberg plugin.
I don't think so @noisysocks, I believe the filter and |
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
89f679f
to
479c231
Compare
|
Merging. Test failures seem to be caused by flakiness - they vary from run to run and seem to be unrelated to this PR. |
This reverts commit 45f1d67.
This reverts commit 45f1d67.
|
I'm almost positive this PR introduced the test failure related to
Also, locally, I get the error related to So I did try including a revert of this PR in #25923, and while it made the |
|
I think this fixes it: #25935 |
|
I believe what happened here is that some of the failing tests I've seen were random and varied from rerun to rerun, while others were constant and caused by this PR - I totally missed the latter. When restarting selenium multiple time fixes most of the failures, I find it too easy to dismiss the ones that turn out to be real, especially when the change seems unrelated. While being more careful is the solution for now, I'd love to have these tests based on something more reliable (cypress?) one day. Thank you so much for fixing it @noahtallen ! 🙇 |
|
Totally! It also looks like the root issue was in WordPress core, so it was easy to miss locally unless the local environment was completely up to date. |
Description
Fixes #15644 by plugging into
should_load_block_editor_scripts_and_stylesfilter and returningtrueon widgets editor screen.Note that this PR will only fix the problem on latest WP trunk, but it won't break anything on older WP versions.
How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: