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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/block-library/src/home-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
$colors['css_classes'],
$font_sizes['css_classes']
);
$classes[] = 'wp-block-navigation-item';
$style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
$css_classes = trim( implode( ' ', $classes ) ) . ' wp-block-navigation-item';

$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.

'style' => $style_attribute,
)
);
Expand Down