-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Use null coalescing operator (??) for remaining instances of isset() ternaries
#10654
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
base: trunk
Are you sure you want to change the base?
Use null coalescing operator (??) for remaining instances of isset() ternaries
#10654
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
??) for remaining uses of isset()
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
… place of `isset()` in ternaries. Developed as a subset of #10654 Follow-up to [61404], [61403]. See #58874, #63430. git-svn-id: https://develop.svn.wordpress.org/trunk@61424 602fd350-edb4-49c9-b593-d223f7449a82
* trunk: Code Modernization: Update `tests` to use null coalescing operator in place of `isset()` in ternaries.
… place of `isset()` in ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Follow-up to [61404], [61403]. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61424 git-svn-id: http://core.svn.wordpress.org/trunk@60736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
… place of `isset()` in ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Follow-up to [61404], [61403]. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61424 git-svn-id: https://core.svn.wordpress.org/trunk@60736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
??) for remaining uses of isset()??) for remaining instances of isset() ternaries
Co-authored-by: Colin Stewart <[email protected]>
…f `isset()` in ternaries. Developed as a subset of #10654 Initially developed in #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
…ss-develop into trac-63430-null-coalescing * 'trunk' of https://github.com/WordPress/wordpress-develop: Code Modernization: REST API: Use null coalescing operator in place of `isset()` in ternaries.
…f `isset()` in ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61429 git-svn-id: http://core.svn.wordpress.org/trunk@60741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…f `isset()` in ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61429 git-svn-id: https://core.svn.wordpress.org/trunk@60741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ead of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
* trunk: Code Modernization: Block Supports: Use null coalescing operator instead of `isset()` ternaries.
…ead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61430 git-svn-id: http://core.svn.wordpress.org/trunk@60742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61430 git-svn-id: https://core.svn.wordpress.org/trunk@60742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
…isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61431 git-svn-id: https://core.svn.wordpress.org/trunk@60743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…f `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61433 git-svn-id: https://core.svn.wordpress.org/trunk@60745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
… `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
… `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61434 git-svn-id: http://core.svn.wordpress.org/trunk@60746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
… `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61434 git-svn-id: https://core.svn.wordpress.org/trunk@60746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…set()` ternaries. Developed as a subset of #10654 Initially developed in #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
…set()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61435 git-svn-id: http://core.svn.wordpress.org/trunk@60747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
…set()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [61434], [61403], [61433], [61432], [61431], [61430], [61429], [61424], [61404], [61403]. Props costdev, westonruter. See #58874, #63430. Built from https://develop.svn.wordpress.org/trunk@61435 git-svn-id: https://core.svn.wordpress.org/trunk@60747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61436 git-svn-id: http://core.svn.wordpress.org/trunk@60748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61436 git-svn-id: https://core.svn.wordpress.org/trunk@60748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ad of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
…ad of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61442 git-svn-id: http://core.svn.wordpress.org/trunk@60754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ad of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61442 git-svn-id: https://core.svn.wordpress.org/trunk@60754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ss-develop into trac-63430-null-coalescing * 'trunk' of https://github.com/WordPress/wordpress-develop: Code Modernization: Script Loader: Use null coalescing operator instead of `isset()` ternaries.
…ead of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
…ss-develop into trac-63430-null-coalescing * 'trunk' of https://github.com/WordPress/wordpress-develop: Code Modernization: Bootstrap/Load: Use null coalescing operator instead of `isset()` ternaries.
…ead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61443 git-svn-id: http://core.svn.wordpress.org/trunk@60755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61443 git-svn-id: https://core.svn.wordpress.org/trunk@60755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
…ss-develop into trac-63430-null-coalescing * 'trunk' of https://github.com/WordPress/wordpress-develop: Code Modernization: Site Health, Permalinks, I18N, Users, Multisite: Use null coalescing operator instead of `isset()` ternaries.
…Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61444 git-svn-id: http://core.svn.wordpress.org/trunk@60756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#4886 Follow-up to [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@61444 git-svn-id: https://core.svn.wordpress.org/trunk@60756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ery, General: Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of #10654 Initially developed in #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
…ery, General: Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#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. Built from https://develop.svn.wordpress.org/trunk@61445 git-svn-id: http://core.svn.wordpress.org/trunk@60757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ery, General: Use null coalescing operator instead of `isset()` ternaries. Developed as a subset of WordPress/wordpress-develop#10654 Initially developed in WordPress/wordpress-develop#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. Built from https://develop.svn.wordpress.org/trunk@61445 git-svn-id: https://core.svn.wordpress.org/trunk@60757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a follow-up up to r61403.
I used PHPStorm's regex search and replace with the pattern
((?:return|echo|\(|,|\s=|\.=|=>)\s*)isset\(\s*(.+?)\s*\)\s*\?\s*\2(\s*):and the replacement$1$2$3??.Paths omitted from replacement:
src/wp-content/themes(since older versions of PHP may need to be supported)src/wp-includes/class-wp-block-parser-frame.php(synced from Gutenberg)src/wp-includes/ID3(external library)src/wp-includes/blocks(synced from Gutenberg)Trac ticket: https://core.trac.wordpress.org/ticket/58874
Trac ticket: https://core.trac.wordpress.org/ticket/63430
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.