Skip to content

Block Library: Remove redundant parentheses around assignments#79516

Merged
Soean merged 1 commit into
trunkfrom
fix/remove-redundant-parentheses-block-library-php
Jun 25, 2026
Merged

Block Library: Remove redundant parentheses around assignments#79516
Soean merged 1 commit into
trunkfrom
fix/remove-redundant-parentheses-block-library-php

Conversation

@Soean

@Soean Soean commented Jun 25, 2026

Copy link
Copy Markdown
Member

What?

Removes unnecessary parentheses that wrapped the right-hand side of assignment expressions in three block render functions:

  • home-link/index.php$style_attribute assignment
  • page-list/index.php$style_attribute assignment
  • tag-cloud/index.php$unit ternary assignment

Why?

The parentheses had no functional effect and only added visual noise. Removing them makes the assignments easier to read and aligns with the style used elsewhere in the codebase.

How?

Stripped the surrounding ( ... ) from each assignment's value.

Testing Instructions

This is a pure cleanup with no behavior change.

Remove unnecessary parentheses wrapping right-hand-side expressions in the Home Link, Page List, and Tag Cloud render functions. These had no functional effect and slightly hurt readability.
@Soean Soean requested a review from ajitbohra as a code owner June 25, 2026 05:18
@Soean Soean added the [Type] Code Quality Issues or PRs that relate to code quality label Jun 25, 2026
@Soean Soean requested a review from fabiankaegy as a code owner June 25, 2026 05:18
@Soean Soean added the [Feature] Block Locking The API allowing for the ability to lock/unlock blocks label Jun 25, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 25, 2026

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch!

@github-actions

Copy link
Copy Markdown

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: Soean <soean@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

@Soean Soean merged commit 989e47e into trunk Jun 25, 2026
59 of 61 checks passed
@Soean Soean deleted the fix/remove-redundant-parentheses-block-library-php branch June 25, 2026 09:41
@github-actions github-actions Bot added this to the Gutenberg 23.6 milestone Jun 25, 2026
SainathPoojary pushed a commit to SainathPoojary/gutenberg that referenced this pull request Jun 29, 2026
…ress#79516)

Remove unnecessary parentheses wrapping right-hand-side expressions in the Home Link, Page List, and Tag Cloud render functions. These had no functional effect and slightly hurt readability.

Co-authored-by: Soean <soean@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Block Locking The API allowing for the ability to lock/unlock blocks [Package] Block library /packages/block-library [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