Commit 00674c45be for wordpress.org
commit 00674c45be2915cd91956ac04cc11d519306e043
Author: Weston Ruter <weston@xwp.co>
Date: Tue Jan 6 05:36:58 2026 +0000
Code Modernization: Bootstrap/Load: Use null coalescing operator instead of `isset()` ternaries.
Developed as a subset of https://github.com/WordPress/wordpress-develop/pull/10654
Initially developed in https://github.com/WordPress/wordpress-develop/pull/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
diff --git a/wp-includes/class-wp-paused-extensions-storage.php b/wp-includes/class-wp-paused-extensions-storage.php
index 91f562c52c..8b615b91d6 100644
--- a/wp-includes/class-wp-paused-extensions-storage.php
+++ b/wp-includes/class-wp-paused-extensions-storage.php
@@ -161,7 +161,7 @@ class WP_Paused_Extensions_Storage {
$paused_extensions = (array) get_option( $option_name, array() );
- return isset( $paused_extensions[ $this->type ] ) ? $paused_extensions[ $this->type ] : array();
+ return $paused_extensions[ $this->type ] ?? array();
}
/**
diff --git a/wp-includes/css/dist/index.php b/wp-includes/css/dist/index.php
index 518cd0892f..ef33115729 100644
--- a/wp-includes/css/dist/index.php
+++ b/wp-includes/css/dist/index.php
@@ -7,14 +7,19 @@
*/
return array(
+ array(
+ 'handle' => 'wp-list-reusable-blocks',
+ 'path' => 'list-reusable-blocks/style',
+ 'dependencies' => array('wp-components'),
+ ),
array(
'handle' => 'wp-nux',
'path' => 'nux/style',
'dependencies' => array('wp-components'),
),
array(
- 'handle' => 'wp-list-reusable-blocks',
- 'path' => 'list-reusable-blocks/style',
+ 'handle' => 'wp-commands',
+ 'path' => 'commands/style',
'dependencies' => array('wp-components'),
),
array(
@@ -28,18 +33,13 @@ return array(
'dependencies' => array('wp-block-editor', 'wp-components'),
),
array(
- 'handle' => 'wp-patterns',
- 'path' => 'patterns/style',
+ 'handle' => 'wp-widgets',
+ 'path' => 'widgets/style',
'dependencies' => array('wp-block-editor', 'wp-components'),
),
array(
- 'handle' => 'wp-commands',
- 'path' => 'commands/style',
- 'dependencies' => array('wp-components'),
- ),
- array(
- 'handle' => 'wp-widgets',
- 'path' => 'widgets/style',
+ 'handle' => 'wp-patterns',
+ 'path' => 'patterns/style',
'dependencies' => array('wp-block-editor', 'wp-components'),
),
array(
@@ -52,31 +52,31 @@ return array(
'path' => 'format-library/style',
'dependencies' => array('wp-block-editor', 'wp-components'),
),
- array(
- 'handle' => 'wp-block-directory',
- 'path' => 'block-directory/style',
- 'dependencies' => array('wp-block-editor', 'wp-components', 'wp-editor'),
- ),
array(
'handle' => 'wp-media-utils',
'path' => 'media-utils/style',
'dependencies' => array('wp-components'),
),
+ array(
+ 'handle' => 'wp-block-directory',
+ 'path' => 'block-directory/style',
+ 'dependencies' => array('wp-block-editor', 'wp-components', 'wp-editor'),
+ ),
array(
'handle' => 'wp-customize-widgets',
'path' => 'customize-widgets/style',
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-preferences', 'wp-widgets'),
),
- array(
- 'handle' => 'wp-edit-post',
- 'path' => 'edit-post/style',
- 'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-preferences', 'wp-widgets'),
- ),
array(
'handle' => 'wp-edit-widgets',
'path' => 'edit-widgets/style',
'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-components', 'wp-media-utils', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
),
+ array(
+ 'handle' => 'wp-edit-post',
+ 'path' => 'edit-post/style',
+ 'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-preferences', 'wp-widgets'),
+ ),
array(
'handle' => 'wp-block-library',
'path' => 'block-library/style',
diff --git a/wp-includes/error-protection.php b/wp-includes/error-protection.php
index 08c4159665..b9cff7073d 100644
--- a/wp-includes/error-protection.php
+++ b/wp-includes/error-protection.php
@@ -46,7 +46,7 @@ function wp_paused_themes() {
*/
function wp_get_extension_error_description( $error ) {
$constants = get_defined_constants( true );
- $constants = isset( $constants['Core'] ) ? $constants['Core'] : $constants['internal'];
+ $constants = $constants['Core'] ?? $constants['internal'];
$core_errors = array();
foreach ( $constants as $constant => $value ) {
diff --git a/wp-includes/js/dist/script-modules/index.php b/wp-includes/js/dist/script-modules/index.php
index 1c77da20bf..9438e8294f 100644
--- a/wp-includes/js/dist/script-modules/index.php
+++ b/wp-includes/js/dist/script-modules/index.php
@@ -7,26 +7,11 @@
*/
return array(
- array(
- 'id' => '@wordpress/interactivity-router',
- 'path' => 'interactivity-router/index',
- 'asset' => 'interactivity-router/index.min.asset.php',
- ),
- array(
- 'id' => '@wordpress/interactivity-router/full-page',
- 'path' => 'interactivity-router/full-page',
- 'asset' => 'interactivity-router/full-page.min.asset.php',
- ),
array(
'id' => '@wordpress/interactivity',
'path' => 'interactivity/index',
'asset' => 'interactivity/index.min.asset.php',
),
- array(
- 'id' => '@wordpress/abilities',
- 'path' => 'abilities/index',
- 'asset' => 'abilities/index.min.asset.php',
- ),
array(
'id' => '@wordpress/latex-to-mathml',
'path' => 'latex-to-mathml/index',
@@ -37,6 +22,21 @@ return array(
'path' => 'latex-to-mathml/loader',
'asset' => 'latex-to-mathml/loader.min.asset.php',
),
+ array(
+ 'id' => '@wordpress/interactivity-router',
+ 'path' => 'interactivity-router/index',
+ 'asset' => 'interactivity-router/index.min.asset.php',
+ ),
+ array(
+ 'id' => '@wordpress/interactivity-router/full-page',
+ 'path' => 'interactivity-router/full-page',
+ 'asset' => 'interactivity-router/full-page.min.asset.php',
+ ),
+ array(
+ 'id' => '@wordpress/abilities',
+ 'path' => 'abilities/index',
+ 'asset' => 'abilities/index.min.asset.php',
+ ),
array(
'id' => '@wordpress/a11y',
'path' => 'a11y/index',
diff --git a/wp-includes/load.php b/wp-includes/load.php
index 434d836f67..90318acddd 100644
--- a/wp-includes/load.php
+++ b/wp-includes/load.php
@@ -13,7 +13,7 @@
* @return string The HTTP protocol. Default: HTTP/1.0.
*/
function wp_get_server_protocol() {
- $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : '';
+ $protocol = $_SERVER['SERVER_PROTOCOL'] ?? '';
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) {
$protocol = 'HTTP/1.0';
@@ -115,7 +115,7 @@ function wp_populate_basic_auth_from_authorization_header() {
}
// From our prior conditional, one of these must be set.
- $header = isset( $_SERVER['HTTP_AUTHORIZATION'] ) ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
+ $header = $_SERVER['HTTP_AUTHORIZATION'] ?? $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
// Test to make sure the pattern matches expected.
if ( ! preg_match( '%^Basic [a-z\d/+]*={0,2}$%i', $header ) ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 7993ce98e6..4a5c1a57ba 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61442';
+$wp_version = '7.0-alpha-61443';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.