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

Sync: Don't enqueue edit site stylesheet in iframe #5309

Conversation

Mamaduka
Copy link
Member

Note: This is probably better to merge after packages are synced, because without CSS changes from the PR the site editor produced as console warning.

index.js:148 wp-edit-site-css was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.

Gutenberg PR: WordPress/gutenberg#54254
Trac ticket: https://core.trac.wordpress.org/ticket/59456


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.

@@ -299,7 +299,7 @@ function get_legacy_widget_block_editor_settings() {
* }
*/
function _wp_get_iframed_editor_assets() {
global $wp_styles, $wp_scripts, $pagenow;
global $wp_styles, $wp_scripts;
Copy link
Member

Choose a reason for hiding this comment

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

@Mamaduka Remove the global annotation from document.

* @global string     $pagenow    The filename of the current screen.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @mukeshpanchal27. I'll take care of this when committing.

Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

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

Compared the function and changes to what's in Gutenberg. This PR removes the part that is no longer needed.

When committing, I'll remove the @global reference in the DocBlock, as noted by @mukeshpanchal27.

This patch is ready for commit.

@hellofromtonya
Copy link
Contributor

@Mamaduka Mamaduka deleted the sync/editor-iframe-remove-edit-site-css branch September 28, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants