-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Code Modernization: Replace some ternaries with null coalescing operator. #4886
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
Closed
costdev
wants to merge
28
commits into
WordPress:trunk
from
costdev:replace_isset_ternary_with_null_coalescing_operator
Closed
Code Modernization: Replace some ternaries with null coalescing operator. #4886
costdev
wants to merge
28
commits into
WordPress:trunk
from
costdev:replace_isset_ternary_with_null_coalescing_operator
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11b83d3 to
51984d2
Compare
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Jan 9, 2026
…rator instead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61454 git-svn-id: http://core.svn.wordpress.org/trunk@60766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento
pushed a commit
that referenced
this pull request
Jan 9, 2026
…tead of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #4886 Follow-up to [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61455 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Jan 9, 2026
…tead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61455 git-svn-id: http://core.svn.wordpress.org/trunk@60767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot
pushed a commit
to gilzow/wordpress-performance
that referenced
this pull request
Jan 9, 2026
…rator instead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61454 git-svn-id: https://core.svn.wordpress.org/trunk@60766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot
pushed a commit
to gilzow/wordpress-performance
that referenced
this pull request
Jan 9, 2026
…tead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61455 git-svn-id: https://core.svn.wordpress.org/trunk@60767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento
pushed a commit
that referenced
this pull request
Jan 9, 2026
…ead of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #4886 Follow-up to [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61456 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Jan 9, 2026
…ead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61456 git-svn-id: http://core.svn.wordpress.org/trunk@60768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento
pushed a commit
that referenced
this pull request
Jan 9, 2026
… ternaries in remaining core files. Developed as a subset of #10654 Initially developed in #4886 Follow-up to [61456], [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter, jrf, SergeyBiryukov, swissspidy, hellofromTonya, marybaum, oglekler, dmsnell, chaion07, noisysocks, mukesh27. See #63430. Fixes #58874. git-svn-id: https://develop.svn.wordpress.org/trunk@61457 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Jan 9, 2026
… ternaries in remaining core files. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61456], [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter, jrf, SergeyBiryukov, swissspidy, hellofromTonya, marybaum, oglekler, dmsnell, chaion07, noisysocks, mukesh27. See #63430. Fixes #58874. Built from https://develop.svn.wordpress.org/trunk@61457 git-svn-id: http://core.svn.wordpress.org/trunk@60769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot
pushed a commit
to platformsh/wordpress-performance
that referenced
this pull request
Jan 9, 2026
…ead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61456 git-svn-id: https://core.svn.wordpress.org/trunk@60768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot
pushed a commit
to platformsh/wordpress-performance
that referenced
this pull request
Jan 9, 2026
… ternaries in remaining core files. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61456], [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter, jrf, SergeyBiryukov, swissspidy, hellofromTonya, marybaum, oglekler, dmsnell, chaion07, noisysocks, mukesh27. See #63430. Fixes #58874. Built from https://develop.svn.wordpress.org/trunk@61457 git-svn-id: https://core.svn.wordpress.org/trunk@60769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…f `isset()` in ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61429 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…ead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61430 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61431 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…`isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61432 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…f `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61433 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
… `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61434 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…set()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61435 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61436 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…ad of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61442 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…ead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61443 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61444 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…ery, General: Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61445 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…sset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61453 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…rator instead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61454 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…tead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61455 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
…ead of `isset()` ternaries. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61456 602fd350-edb4-49c9-b593-d223f7449a82
aaronjorbin
pushed a commit
to aaronjorbin/wordpress-develop
that referenced
this pull request
Jan 12, 2026
… ternaries in remaining core files. Developed as a subset of WordPress#10654 Initially developed in WordPress#4886 Follow-up to [61456], [61455], [61454], [61453], [61445], [61444], [61443], [61442], [61436], [61435], [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter, jrf, SergeyBiryukov, swissspidy, hellofromTonya, marybaum, oglekler, dmsnell, chaion07, noisysocks, mukesh27. See #63430. Fixes #58874. git-svn-id: https://develop.svn.wordpress.org/trunk@61457 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains commits separated by component for easier reviewing/possible commit.
Changes can be reviewed altogether or per PR commit.
If moved forward for merging to WordPress Core, this PR's commits can be merged individually, grouped into smaller chunks, or squashed into a single commit.
Trac ticket: https://core.trac.wordpress.org/ticket/58874