Skip to content

remove unnecessary condition from assets-loading#3395

Closed
aristath wants to merge 1 commit intoWordPress:trunkfrom
aristath:fix/blocks-view-scripts-loading
Closed

remove unnecessary condition from assets-loading#3395
aristath wants to merge 1 commit intoWordPress:trunkfrom
aristath:fix/blocks-view-scripts-loading

Conversation

@aristath
Copy link
Copy Markdown
Member

@aristath aristath commented Oct 3, 2022

It appears that an extra condition was preventing multiple scripts from loading in blocks like the navigation block - where we need a separate script for the modal.

This patch removes an additional condition that is not necessary.
Whether a style or script gets enqueued should not be related to the block's render callback.

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


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.

@cbravobernal
Copy link
Copy Markdown
Contributor

Nice job!! Work as expected

@aristath
Copy link
Copy Markdown
Member Author

aristath commented Oct 3, 2022

Note: This was reported in WordPress/twentytwentythree#214, then WordPress/gutenberg#44638

@dream-encode
Copy link
Copy Markdown
Contributor

Merged into core in https://core.trac.wordpress.org/changeset/54367.

Copy link
Copy Markdown
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 @aristath. LGTM

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.

4 participants