Commit 9de55039fa for wordpress.org
commit 9de55039faf076e4ca08c2029b8bec5e7884eca5
Author: Weston Ruter <weston@xwp.co>
Date: Sat Jan 10 18:30:59 2026 +0000
Widgets: Ensure a widget is registered prior to checking its ID in `is_active_widget()`.
This avoids a possible PHP warning due to an undefined array key.
Developed in https://github.com/WordPress/wordpress-develop/pull/10710
Follow-up to [11090], [7080].
Props sageth, josephscott, Ipstenu, mindctrl, westonruter.
See #8441, #6023.
Fixes #57518.
Built from https://develop.svn.wordpress.org/trunk@61466
git-svn-id: http://core.svn.wordpress.org/trunk@60778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/css/dist/index.php b/wp-includes/css/dist/index.php
index 0bdf505c53..e2d1a3addc 100644
--- a/wp-includes/css/dist/index.php
+++ b/wp-includes/css/dist/index.php
@@ -22,11 +22,6 @@ return array(
'path' => 'list-reusable-blocks/style',
'dependencies' => array('wp-components'),
),
- array(
- 'handle' => 'wp-commands',
- 'path' => 'commands/style',
- 'dependencies' => array('wp-components'),
- ),
array(
'handle' => 'wp-reusable-blocks',
'path' => 'reusable-blocks/style',
@@ -38,15 +33,20 @@ return array(
'dependencies' => array('wp-block-editor', 'wp-components'),
),
array(
- 'handle' => 'wp-widgets',
- 'path' => 'widgets/style',
- 'dependencies' => array('wp-block-editor', 'wp-components'),
+ 'handle' => 'wp-commands',
+ 'path' => 'commands/style',
+ 'dependencies' => array('wp-components'),
),
array(
'handle' => 'wp-components',
'path' => 'components/style',
'dependencies' => array(),
),
+ array(
+ 'handle' => 'wp-widgets',
+ 'path' => 'widgets/style',
+ 'dependencies' => array('wp-block-editor', 'wp-components'),
+ ),
array(
'handle' => 'wp-format-library',
'path' => 'format-library/style',
@@ -57,16 +57,16 @@ return array(
'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-media-utils',
'path' => 'media-utils/style',
'dependencies' => array('wp-components'),
),
+ 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-widgets',
'path' => 'edit-widgets/style',
@@ -87,14 +87,14 @@ return array(
'path' => 'editor/style',
'dependencies' => array('wp-block-editor', 'wp-commands', 'wp-components', 'wp-media-utils', 'wp-patterns', 'wp-preferences'),
),
- array(
- 'handle' => 'wp-edit-site',
- 'path' => 'edit-site/style',
- 'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
- ),
array(
'handle' => 'wp-block-editor',
'path' => 'block-editor/style',
'dependencies' => array('wp-commands', 'wp-components', 'wp-preferences'),
),
+ array(
+ 'handle' => 'wp-edit-site',
+ 'path' => 'edit-site/style',
+ 'dependencies' => array('wp-block-editor', 'wp-block-library', 'wp-commands', 'wp-components', 'wp-editor', 'wp-patterns', 'wp-preferences', 'wp-widgets'),
+ ),
);
diff --git a/wp-includes/js/dist/script-modules/index.php b/wp-includes/js/dist/script-modules/index.php
index 0583013225..5147fa73bb 100644
--- a/wp-includes/js/dist/script-modules/index.php
+++ b/wp-includes/js/dist/script-modules/index.php
@@ -7,6 +7,26 @@
*/
return array(
+ 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',
+ 'asset' => 'latex-to-mathml/index.min.asset.php',
+ ),
+ array(
+ 'id' => '@wordpress/latex-to-mathml/loader',
+ 'path' => 'latex-to-mathml/loader',
+ 'asset' => 'latex-to-mathml/loader.min.asset.php',
+ ),
array(
'id' => '@wordpress/a11y',
'path' => 'a11y/index',
@@ -22,31 +42,11 @@ return array(
'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/core-abilities',
'path' => 'core-abilities/index',
'asset' => 'core-abilities/index.min.asset.php',
),
- array(
- 'id' => '@wordpress/interactivity',
- 'path' => 'interactivity/index',
- 'asset' => 'interactivity/index.min.asset.php',
- ),
- array(
- 'id' => '@wordpress/latex-to-mathml',
- 'path' => 'latex-to-mathml/index',
- 'asset' => 'latex-to-mathml/index.min.asset.php',
- ),
- array(
- 'id' => '@wordpress/latex-to-mathml/loader',
- 'path' => 'latex-to-mathml/loader',
- 'asset' => 'latex-to-mathml/loader.min.asset.php',
- ),
array(
'id' => '@wordpress/route',
'path' => 'route/index',
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 4e22ee19ab..f91c0d7a74 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61465';
+$wp_version = '7.0-alpha-61466';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php
index 6b216c2d3c..799a597361 100644
--- a/wp-includes/widgets.php
+++ b/wp-includes/widgets.php
@@ -925,7 +925,7 @@ function is_active_widget( $callback = false, $widget_id = false, $id_base = fal
if ( is_array( $widgets ) ) {
foreach ( $widgets as $widget ) {
if ( ( $callback && isset( $wp_registered_widgets[ $widget ]['callback'] ) && $wp_registered_widgets[ $widget ]['callback'] === $callback ) || ( $id_base && _get_widget_id_base( $widget ) === $id_base ) ) {
- if ( ! $widget_id || $widget_id === $wp_registered_widgets[ $widget ]['id'] ) {
+ if ( ! $widget_id || ( isset( $wp_registered_widgets[ $widget ]['id'] ) && $widget_id === $wp_registered_widgets[ $widget ]['id'] ) ) {
return $sidebar;
}
}