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

Conditionally load registered block-styles depending on wp_should_load_separate_core_block_assets #1482

Closed
wants to merge 2 commits into from

Conversation

aristath
Copy link
Member

@aristath aristath commented Jul 7, 2021

This PR modifies the enqueue_block_styles_assets function, adding conditions for wp_should_load_separate_core_block_assets() and making sure that registered block-styles only load when a block gets rendered on a page.

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


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

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

This is a really nice enhancement. Thank you for working on it. I left two minor notes to discuss. Let's include those changes in WP 5.9 💯

@gziolo
Copy link
Member

gziolo commented Jul 22, 2021

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.

2 participants