[wp-trac] [WordPress Trac] #57647: Deprecate wp_enqueue_block_support_styles function
WordPress Trac
noreply at wordpress.org
Mon Feb 6 23:30:35 UTC 2023
#57647: Deprecate wp_enqueue_block_support_styles function
--------------------------+-----------------------------
Reporter: andrewserong | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Prior to the style engine classes being added to core, the code for block
supports used the `wp_enqueue_block_support_styles` function to output a
`<style>` tag containing the CSS styles for the block support. Using this
function resulted in duplicate `<style>` tags being output on the site
frontend, and redundant CSS rules.
As of 6.2, it looks like all of the block supports and block's individual
PHP rendering will have been refactored to use the style engine's approach
of enqueuing styles, where styles are registered using a common call to
the style engine, and then only output once in a single style tag. For
example, the Layout block support uses
`wp_style_engine_get_stylesheet_from_css_rules` instead of
`wp_enqueue_block_support_styles`.
Therefore, it should now be possible to deprecate usage of the
`wp_enqueue_block_support_styles` function, and nudge any usage of that
function over to use comparable style engine functions instead.
Note: this deprecation should only occur once all usage of
`wp_enqueue_block_support_styles` has been removed in core blocks, which
should happen once the JS packages update for 6.2 has occurred, as that
update should replace the call with a call to the style engine instead.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57647>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list