fix: force to load core block assets since WP 6.9#54
Conversation
There was a problem hiding this comment.
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
falseto disable separate core block assets.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * | ||
| * @see https://github.com/roots/sage/pull/3279 | ||
| */ | ||
| #[Action('should_load_separate_core_block_assets')] |
There was a problem hiding this comment.
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.
| #[Action('should_load_separate_core_block_assets')] | |
| #[Filter('should_load_separate_core_block_assets')] |
| * @see https://github.com/roots/sage/pull/3279 | ||
| */ | ||
| #[Action('should_load_separate_core_block_assets')] | ||
| public function forceLoadSeparateCoreBlockAssets(): bool |
There was a problem hiding this comment.
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.
| public function forceLoadSeparateCoreBlockAssets(): bool | |
| public function disableSeparateCoreBlockAssets(): bool |
YvetteNikolov
left a comment
There was a problem hiding this comment.
Na suggesties van copilot akkoord
No description provided.