Update doc for legacy widget asset loading#49791
Update doc for legacy widget asset loading#49791sagarnasit wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @sagarnasit! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
| } ); | ||
| ``` | ||
|
|
||
| To load the styles and scripts on the editor for the Legacy Widget block, it's recommended to use constructore of the widget registration class or a widget method. It will ensure style and script being loaded on the iFrame as well. |
There was a problem hiding this comment.
Thank you for this suggestion @sagarnasit.
I'm not sure if we want to make that an official recommendation. But I guess we could phrase it as:
A possible way to ensure the styles and scripts are loaded on the editor for the Legacy Widget block, is to enqueue the assents on the constructor of the widget registration class or a widget method. It will ensure style and script are loaded on the iFrame as well.
That way we still provide useful information to developers without sounding like it is an official guideline. What do you think? Thank you in advance for your thoughts/insights.
|
Closing this as Stale. |
What?
Update documentation on how to load styles and scripts within the legacy widget iframe.
Why?
Legacy widgets use an iframe to load the widget content on the editor. in the current documentation, It is not clear how to load style and script within the iFrame.
How?
PR states the suitable ways of enqueueing legacy widget styles and scripts.
issue #33584