Skip to content

Conversation

shimotmk
Copy link
Contributor

What?

Similar #56997

Fix duplicate output of Dimensions styling rules for the Cover block.

Why?

How?

Add a remove_filter line to disable core's callback for the dimensions support if present

Testing Instructions

  1. Open a post or page.
  2. Insert a Cover block.
  3. Set Aspect radio
  4. You will see the styles being rendered twice on the frontend.

Testing Instructions for Keyboard

Screenshots or screencast

Before After
before after

@shimotmk shimotmk requested a review from spacedmonkey as a code owner July 19, 2025 02:13
Copy link

github-actions bot commented Jul 19, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shimotmk <shimotomoki@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

The wp_render_dimensions_support function has been around since WordPress 6.5.0. And the current Gutenberg plugin supports WordPress 6.7 and above. This means that there should be no need to check for the existence of the wp_render_dimensions_support() function:

remove_filter( 'render_block', 'wp_render_dimensions_support', 10 );
add_filter( 'render_block', 'gutenberg_render_dimensions_support', 10, 2 );

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Layout Layout block support, its UI controls, and style output. labels Jul 19, 2025
@shimotmk
Copy link
Contributor Author

Thank you. I fixed it!

@t-hamano t-hamano added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Jul 19, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@t-hamano t-hamano merged commit 7d04517 into WordPress:trunk Jul 19, 2025
63 of 64 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.3 milestone Jul 19, 2025
@shimotmk shimotmk deleted the fix/double-output-of-dimensions-styles branch July 19, 2025 09:59
USERSATOSHI pushed a commit to USERSATOSHI/gutenberg that referenced this pull request Jul 23, 2025
…70796)

* dimensions support: Remove double output of styling rules

* remove function_exists

remove_filter( 'render_block', 'wp_render_dimensions_support', 10 );
add_filter( 'render_block', 'gutenberg_render_dimensions_support', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants