Skip to content

Update doc for legacy widget asset loading#49791

Closed
sagarnasit wants to merge 2 commits intoWordPress:trunkfrom
sagarnasit:fix/gh-33584
Closed

Update doc for legacy widget asset loading#49791
sagarnasit wants to merge 2 commits intoWordPress:trunkfrom
sagarnasit:fix/gh-33584

Conversation

@sagarnasit
Copy link

@sagarnasit sagarnasit commented Apr 13, 2023

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

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 13, 2023
@github-actions
Copy link

👋 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.

@sagarnasit sagarnasit marked this pull request as draft April 13, 2023 10:05
@sagarnasit sagarnasit marked this pull request as ready for review April 14, 2023 08:16
@skorasaurus skorasaurus added the [Type] Developer Documentation Documentation for developers label Apr 18, 2023
} );
```

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.
Copy link
Member

Choose a reason for hiding this comment

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

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.

@jorgefilipecosta jorgefilipecosta added the [Status] Needs More Info Follow-up required in order to be actionable. label Oct 9, 2023
@github-actions github-actions bot added the Stale label Oct 29, 2023
@gziolo gziolo added [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. and removed Stale labels Sep 9, 2024
@Mamaduka
Copy link
Member

Mamaduka commented Aug 4, 2025

Closing this as Stale.

@Mamaduka Mamaduka closed this Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments