Skip to content

fix: force to load core block assets since WP 6.9#54

Open
laravdiemen wants to merge 1 commit into
mainfrom
fix/load-core-block-assets-wp-6-9
Open

fix: force to load core block assets since WP 6.9#54
laravdiemen wants to merge 1 commit into
mainfrom
fix/load-core-block-assets-wp-6-9

Conversation

@laravdiemen
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a WordPress hook override in the hooks package to address WordPress 6.9 behavior around core block asset loading.

Changes:

  • Registers a hook for should_load_separate_core_block_assets.
  • Forces the hook to return false to disable separate core block assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Theme.php
*
* @see https://github.com/roots/sage/pull/3279
*/
#[Action('should_load_separate_core_block_assets')]
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

should_load_separate_core_block_assets is a WordPress filter hook; using the Action attribute here makes the intent unclear. Consider switching this attribute to Filter (and keep the return type bool) to better reflect the hook’s behavior and avoid confusion for future maintainers.

Suggested change
#[Action('should_load_separate_core_block_assets')]
#[Filter('should_load_separate_core_block_assets')]

Copilot uses AI. Check for mistakes.
Comment thread src/Theme.php
* @see https://github.com/roots/sage/pull/3279
*/
#[Action('should_load_separate_core_block_assets')]
public function forceLoadSeparateCoreBlockAssets(): bool
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The method name forceLoadSeparateCoreBlockAssets() suggests enabling separate core block assets, but the implementation returns false (disabling separate assets). Renaming to match the behavior (e.g., disabling separate assets / forcing combined assets) would prevent misunderstandings.

Suggested change
public function forceLoadSeparateCoreBlockAssets(): bool
public function disableSeparateCoreBlockAssets(): bool

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@YvetteNikolov YvetteNikolov left a comment

Choose a reason for hiding this comment

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

Na suggesties van copilot akkoord

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