Skip to content

Refactor: Use null coalescing operator for improved readability#76777

Merged
Soean merged 1 commit intotrunkfrom
coalescing
Mar 25, 2026
Merged

Refactor: Use null coalescing operator for improved readability#76777
Soean merged 1 commit intotrunkfrom
coalescing

Conversation

@Soean
Copy link
Copy Markdown
Member

@Soean Soean commented Mar 24, 2026

What?

This pull request makes minor improvements to how values are retrieved from arrays in the content guidelines code. The main change is the use of the null coalescing operator (??) instead of the isset(...)?...:... ternary pattern, which simplifies and modernizes the code.

@Soean Soean requested a review from spacedmonkey as a code owner March 24, 2026 10:54
@Soean Soean added the [Type] Code Quality Issues or PRs that relate to code quality label Mar 24, 2026
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 24, 2026
@github-actions
Copy link
Copy Markdown

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Soean! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Soean Soean removed the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Mar 24, 2026
@github-actions
Copy link
Copy Markdown

Flaky tests detected in e68d7d4.
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/23485797781
📝 Reported issues:

Copy link
Copy Markdown
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thanks, @Soean!

@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 825ec4b into trunk Mar 25, 2026
46 of 47 checks passed
@Soean Soean deleted the coalescing branch March 25, 2026 13:26
@github-actions github-actions bot added this to the Gutenberg 22.9 milestone Mar 25, 2026
adamsilverstein pushed a commit that referenced this pull request Mar 26, 2026
Co-authored-by: Soean <soean@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
adamsilverstein pushed a commit that referenced this pull request Mar 31, 2026
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

[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