Skip to content

Commit

Permalink
Plugin tweaks: Ensure gutenberg element styles are only generated once.
Browse files Browse the repository at this point in the history
This fixes a compat issue between WP trunk and Gutenberg 17.9-18.2, where element styles (e.g., link colors) added to blocks are not attached correctly.

See WordPress/wporg-parent-2021#135
  • Loading branch information
ryelle committed May 6, 2024
1 parent 73f8ad6 commit 784a6a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mu-plugins/plugin-tweaks/gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
add_filter( 'render_block_core/query-title', __NAMESPACE__ . '\swap_h0_for_paragraph', 20 );
add_filter( 'wp_script_attributes', __NAMESPACE__ . '\inject_module_cachebuster' );

// Remove duplicate elements generation, can be removed after GB18.3+ is active.
// See https://github.com/WordPress/wporg-parent-2021/issues/135.
remove_filter( 'render_block_data', 'wp_render_elements_support_styles', 10, 1 );

/**
* Replace invalid `h0` tags with paragraphs.
*
Expand Down

0 comments on commit 784a6a9

Please sign in to comment.