Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Link Block: Remove leading spaces in class names #49397

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Mar 28, 2023

What?

This PR removes leading spaces in the class name when the Home Link block is rendered as a li element in a navigation block.

Testing Instructions

  • In the site editor, insert the navigation block.
  • Insert a Home Link block in the navigation block.
  • Apply some block styles.
  • On the front end, confirm that there are no leading spaces in the class attribute value.

Before

before

After

after


$wrapper_attributes = get_block_wrapper_attributes(
array(
'class' => $css_classes,
'class' => implode( ' ', $classes ),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The $class array will contain the color classes, font size classes, and wp-block-navigation-item as values, but trim() should not be necessary.

@t-hamano t-hamano self-assigned this Mar 28, 2023
@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Block] Home Link Affects the Home Link Block labels Mar 28, 2023
@t-hamano t-hamano marked this pull request as ready for review March 28, 2023 13:27
@github-actions
Copy link

Flaky tests detected in a11beb0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4543557752
📝 Reported issues:

@t-hamano t-hamano merged commit 646a836 into trunk Mar 29, 2023
@t-hamano t-hamano deleted the fix/home-link-class-space branch March 29, 2023 10:40
@github-actions github-actions bot added this to the Gutenberg 15.5 milestone Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Home Link Affects the Home Link Block [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