內容簡介
此外掛為使用經典佈景主題的網站提供解決方案,修正 WordPress 6.9 版本中載入區塊樣式的問題,並恢復經典佈景主題的舊有行為,改善網站性能。
【主要功能】
• 修正經典佈景主題載入區塊樣式的問題
• 恢復 WordPress 6.9 之前的樣式載入行為
• 減少 CSS 載入量以提升頁面加載速度
外掛標籤
開發者團隊
② 後台搜尋「Load Combined Core Block Assets」→ 直接安裝(推薦)
原文外掛簡介
This is a workaround for sites experiencing any issues with the ability introduced in WordPress 6.9 to load block styles on demand in classic themes. The known issues have been fixed during the 7.0 release cycle with the following commits:
r61076: Script Loader: Fall back to hoisting late-printed styles to end of HEAD if wp-block-library is not enqueued.
r61122: Script Loader: Load block styles on demand in classic themes even when wp-block-styles support is absent.
r61174: Script Loader: Improve hoisted stylesheet ordering (in classic themes) to preserve CSS cascade.
r61554: Script Loader: Preserve original CSS cascade for classic themes when hoisting late-printed styles.
r61945: Script Loader: Refine hoisted stylesheet ordering to preserve original CSS cascade in classic themes.
If running a classic theme (i.e. not a block theme), this plugin filters should_load_separate_core_block_assets to be false. This has the effect of reverting a change introduced in 6.9 where classic themes now load separate core block assets on demand by default.
Note that this plugin should be considered temporary until any issues are resolved in 7.0. At any time, you can test whether any issues remain by adding ?should_load_separate_core_block_assets=true to any frontend URL; this restores the default behavior in WP 6.9.
This workaround should be temporary because there are performance benefits to loading separate core block assets. They can be loaded on demand just when they are used, as opposed to loading the large single combined wp-block-library stylesheet. Loading separate block styles on demand reduces the amount of CSS which should improve page load time. Nevertheless, as explained in the dev note, some sites may be built in a way that fundamentally does not work with loading separate block styles on demand. For these sites, this plugin is available to retain the old behavior.
