وردپرس

Upgrade from Sugar Calendar 3.0.0 to 3.1.x broke layout


In WordPress core as of 5.8.0, the value of should_load_separate_core_block_assets is set to false by default.

In WordPress 5.9.0, _add_default_theme_supports added a filter to set should_load_separate_core_block_assets to true for block themes.

In general, by default, from what I can tell, classic themes expect block assets to be loaded together, block themes expect assets to be provided separately. The filter gives us the ability to customize that.

In Sugar Calendar Lite (and Pro) 3.1.0, should_load_separate_core_block_assets is filtered to true as part of the init process for the blocks included with the plugin. This overrides the default decision by core and causes the entire cascade of styles provided by WordPress to change drastically.

This change broke the layout on the home page of a client site. We were able to narrow it down and resolve with a new action on init that resets should_load_separate_core_block_assets back to its intended value.

IMO, should_load_separate_core_block_assets is a heavy-handed decision and plugins should not be filtering it for all sites without setting the expectation that a major core default is being changed. Instead, plugins should be able to work around their own cascade issues with separate stylesheets or approaches that may rely on the current value of should_load_separate_core_block_assets.

Thanks for listening! ?

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا