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

Plugin: Copy wp_should_load_separate_core_block_assets function from core #32611

Merged
merged 2 commits into from
Jun 11, 2021

Conversation

aristath
Copy link
Member

@aristath aristath commented Jun 11, 2021

Description

The gutenberg_should_load_separate_block_assets function was ported to core as wp_should_load_separate_core_block_assets. Instead of adding a gutenberg_ function in the plugin and calling wp_ inside it, we can simply do a function_exists check, and add the wp_ function in the plugin if the function doesn't exist.

This will make maintenance easier and will allow for easier porting of future code in core.

How has this been tested?

Tested with a block theme and a classic theme in WP5.8-trunk, everything works as expected.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@gziolo
Copy link
Member

gziolo commented Jun 11, 2021

It all depends on whether we are planning to apply any changes to the implementation that exists in WordPress core. It contains a filter so we probably can always use it instead.

@gziolo gziolo changed the title Copy wp_should_load_separate_core_block_assets function from core Plugin: Copy wp_should_load_separate_core_block_assets function from core Jun 11, 2021
@gziolo gziolo added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts Backwards Compatibility Issues or PRs that impact backwards compatability labels Jun 11, 2021
@aristath aristath merged commit 91b8c56 into trunk Jun 11, 2021
@aristath aristath deleted the try/wp_should_load_separate_core_block_assets branch June 11, 2021 11:37
@github-actions github-actions bot added this to the Gutenberg 10.9 milestone Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants