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

Backport _wp_get_iframed_editor_assets #4700

Conversation

ellatrix
Copy link
Member

This includes the changes from:

Trac ticket: https://core.trac.wordpress.org/ticket/58626


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks @ellatrix for the PR.

The document for global variable is missing.

The multiline comment suggestions are based on the fact that the PRs on this ticket should correct all other "multiple single line comments" in this file, so we might as well avoid introducing new ones in this PR and having to update the other one.

@@ -297,65 +297,72 @@ function get_legacy_widget_block_editor_settings() {
* }
*/
function _wp_get_iframed_editor_assets() {
global $pagenow, $editor_styles;
global $wp_styles, $wp_scripts, $pagenow;
Copy link
Member

Choose a reason for hiding this comment

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

Add missing documents for $wp_styles and $wp_scripts

src/wp-includes/block-editor.php Outdated Show resolved Hide resolved
src/wp-includes/block-editor.php Outdated Show resolved Hide resolved
src/wp-includes/block-editor.php Outdated Show resolved Hide resolved
src/wp-includes/block-editor.php Outdated Show resolved Hide resolved
@ellatrix
Copy link
Member Author

Looks like wp_print_fonts is missing. Are we waiting for other back ports?

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

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

Code-wise looks good.

I've tested that is working as expected by looking at what are the assets that are loaded through __unstableResolvedAssets and the ones loaded in the iframe:

  • scripts: the same before/after
  • styles: __unstableResolvedAssets contains now the wp-edit-site-css, as expected (it was loaded through the compat layer before). It also contains the emoji CSS, as expected (we're now loading all assets present in the front).

@tellthemachines
Copy link
Contributor

Committed in r56047 / a7a32c3.

@ellatrix ellatrix deleted the backport/_wp_get_iframed_editor_assets branch July 7, 2023 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

5 participants